Dialogflow set speech response as default auto response - google-cloud-platform

I'm trying to set the response that answers the questions posed to dialogflow to automatically be spoken/set to speech as a default in web-chat.
What I mean is, when the user asks a question, I want the bot to automatically return with a speech response so that the user doesn't have to click the "speack" button on the message.
I'm using a C# API webhook to set the responses to the questions.
Thank you.

You cannot set the Dialogflow generated Audio as the default response. It depends on how the platform, in this case the web-chat, decides to handle the information retrieved by Dialogflow. If you have control over the web-chat code, then you can request Dialogflow to return an audio by sending the outputAudioConfig parameter in the DerectIntentRequest, and then have the web-chat code to play the audio.
If you don't have control over the web-chat, then you'll need to know how they're processing the Dialogflow's response so you can adapt your responses.

Related

DialogFlow, modify user request

for my dialogflow project I would like to intercept the user request before the dialogflow responds with the appropriated intent.
My goal:
-The user sends a request with an input message
-I access this message, I transform it (I apply a function to it) and then it is delivered to the dialogflow (so dialog.
I'm using a webhook linked to an specific intent. I'm using cloud functions to handle the webhook.
I would like to access the request using this webhook, modify the original request and allow dialogflow to respond according to this new modified request.
I hope I've made myself clear.
Thank you very much in advance!
I think it is not possible using a webhook, I suggest you to take a look at the Dialogflow fulfillment documentation. As you can see in the architecture representation, your webhook is behind of the intent matched, so the user request has been processed by Dialogflow and the fulfillment will perform actions based on the matched intent, so you only be able to modify the task on the service that you defined within the fulfillment and its response.
You could be able to do this according to your use-case, if you're using a custom development to make calls to the Dialogflow API, you can add an additional step between End-User and Dialogflow where you could intercept the user request, modify it and then send it to the Dialogflow API.
If you’re using any integrations such as Action on Google or Dialogflow Hangouts, this will not be possible since these services are the ones that manage the calls to the Dialogflow API.

Does Amazon aws lex chatbot supports videos?

I am new to Amazon aws, Is lex chat bot support video eg MP4 , ?
Assume something like this:
Bot: would you like to watch the tutorial?
Human: Yes.
Bot: displays a video
A video can be alone or with response card .
Is this possible????
You can define a custom payload as a response from a Lex bot (using a Lambda function for the fulfillment), but you would also have to integrate the Lex bot into an application that could appropriately handle that response (display the video based on the response from the Lex fulfillment lambda).
The supported message formats are:
PlainText—The message contains plain UTF-8 text.
SSML—The message contains text formatted for voice output.
CustomPayload—The message contains a custom format that you have created for your client. You can define the payload to meet the needs of your application.
Composite—The message is a collection of messages, one from each message group. For more information about message groups, see Message Groups.
Moere info on Lex messaging and the CustomPayload here: https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html
So the answer is that it is possible, but not a built in functionality.
Amazon lex will be able to send whatever response is required, it's the job of chat client to render that response and displays accordingly.
There will be a different way to send a video in response to facebook messenger than slack or any other chat client.
If you need to deploy it to your website, you can check this and this out. It supports HTML and markdown components in response so you can send a video.

make a dialogflow webhook receiver in django

Hi I'm setting up a chatbot using dialogflow, what I want is to integrate dialogflow with django so that a search function in the django server is executed and the result of the research is passed to the chatbot, I made a webhook to the django server in dialogflow using the url "https://0e3c393b.ngrok.io/webhook" but I dont know how make a webhook receiver in django, Any recommendations ?
You should treat it like any other endpoint on django, you will get a request from Dialogflow with a JSON content body, and you will need to reply back with JSON in a specific format. When you want the search behaviour on the chatbot, at that specific intent or flow, have the action be to use a webhook request.
You can find more information here.
https://dialogflow.com/docs/fulfillment/how-it-works

How to integrate AWS Lex Chatbots Voice to Facebook

I had configured my chatbot using AWS Lex Chatbot service. My main intention to create chatbot is to integrate it to Facebook and the user's communication should possible in both text and voice. I integrated my chatbot to facebook successfully by following steps give in AWS documentation. BUt voice piece was not working on facebook. Please, provide me any suggestions or any reference blogs of integrating lex voice piece to Facebook along with the text.
Facebook Messenger doesn't interpret lex responses into Voice responses, at least not yet.
The event object received, when accessing Lex from Facebook, will generate requestAttributes and those specify the accepted content types under x-amz-lex:accept-content-types.
"requestAttributes": {
"x-amz-lex:accept-content-types": "PlainText"
},
As you can see, PlainText is the only accepted content-type. Even though Lex has 4 supported message content-types: 'PlainText', 'SSML', 'CustomPayload', and 'Composite'. See here.
From Facebook Messenger Docs:
The Messenger Platform allows you to attach assets to messages, including audio, video, images, and files.
Even though Facebook accepts attachments of audio, Lex only sends PlainText or SSML.
Lex does use Facebook's messsage attachments when it sends Response Cards, but the Response Cards can only have a Generic Type, so that it only sends images, not audio files. See here.

Aftership webhook tracking API

I am developing one e-commerce app project where I have to track the order status. I use Aftership Webhook API. Webhook provides a tracking event updates to our specified webhook URL(defined in our server). I read documentation but I dont know the proper approach to test the API. and in documentation it is also not defined. Can anyone tell or suggest me how can I test or track the updates.
To test Aftership API, first, you can follow the API reference to get your API key. And to tracking an order with webhook, your need to do the POST /trackings to https://api.aftership.com/v4 beforehand with body like(you can add optional parameter to the request body):
{"tracking": {"tracking_number": "<order tracking number>"}
And then you can follow the webhook documentation and add your webhook URL and configure the types of updates you want to get. At this point, you should be able to see the tracking update HTTP request coming into your webhook URL. Remember it will only send callback request when there is tracking status update.
Also, you can use other tracking APIs to get the status, update the tracking or delete it now.