Can Dialogflow respond with Video? - dialogflow-es

Can Dialogflow respond with Video? I wished to have a video triggered as an intent response but I think there is no way out within the selection.

Through custom payload. You can attach a video type response like in the case of facebook messenger

This is not possible. According to the documentation, the intent response could be a static text or Webhook response, which is a JSON. You may consider to provide a link of the video in the response so the user can get it by clicking it.

Related

How to handle the end of the audio?

I use [media response] (https://developers.google.com/actions/assistant/responses) for play audio.
When the audio finishes, I see actions.intent.MEDIA_STATUS in actions on google simulator. But the dialogflow does not send this intent to my web hook.
How do I set up an dialogflow agent to get this intent?
From doc:
If you're using Dialogflow, replace actions.intent.MEDIA_STATUS with the action name specified in the intent which receives the actions_intent_MEDIA_STATUS event.

Images can be received as input in Dialogflow Chatbot?

i have a Use Case where i need to receive image as input from user in dialogflow chatbot. This images is require to send in webhook request to rest end point as fulfillment.
I couldn't find anything which resembles to my requirement and also not sure whether it is supported in dialogflow or not.
Thanks in advance!
Dialogflow cannot take an image as input and map it to an intent directly. However, what you can do is process that image and send some text to dialogflow which will trigger specific intent and then proceed to perform the desired action.
You need to have a bridge between your user agent and Dialogflow, which will handle all the text/image request. It will do all the pre-processing and then call Dialogflow.
In this way, you need to send message to the messenger user using it's API's and call dialogflow using API/SDK as well.
Hope it helps.

Playing an audio file when using Fulfillment with DialogueFlow

I'm editing the Cloud Functions for Firebase on the Fulfillment page on DialogFlow. I'm trying to respond to an Intent with an audio file playback. Specifically I'm targeting the Telephony integration.
I understand that a text message like
<speak><audio src="https://actions.google.com/sounds/v1/alarms/bugle_tune.ogg"></audio></speak>
Should play the audio.
But what is the interface to send it back so it would work?
Just using agent.add() doesn't seem to work (it reads the SSML string outloud)
You cannot use the client API library to do this at this time. You'll need to craft the JSON response yourself. Please see my answer here which should be helpful: DIalogflow Telephony integration is interpreting SSML response from webhook as normal text
Basically do the same but use TelephonyPlayAudio instead of TelephonySynthesizeSpeech.

Can I get Dialogflow send a request to my webhook when I trigger an event?

I want to trigger an intent/event in Dialogflow [from my webhook/server] and have Dialogflow send a request to my /webhook instead of just responding to the POST request that I made which triggered the event. Is that possible? I want to send the user a message based on their input in our web application, but the response types could vary greatly so I can't define the message and payload in the DF web panel.
edit: [in brackets]
Yes, Dialogflow can send information to a webhook - it refers to this as fulfillment.
Keep in mind that the JSON sent by Dialogflow will be in its format, not yours, and it expects a reply in its format as well. This reply will include the message to be sent back to the user (the response to the original POST request).

How to get dynamic response based on the result of the action performed in Api.ai?

I'm trying out few examples in Api.ai console. I see there are examples where the agent responds by using the values that are extracted from the user query or from the context. But is there a way to display response that is formed using the output of the action performed?
For example -
User: Is my pizza order confirmed?
Action: check order status
Response: Yes, it's confirmed (or "No, it's not")
You will have to use some custom webhook to do this, either integrating with a 3rd party API or will a server side call of your own to a database- in this case the webhook would take the user's ID and query if their pizza is ready or not, and this would then be passed back to API.ai.
Here is an example using a 3rd party webhook to do what you are asking:
https://github.com/api-ai/apiai-weather-webhook-sample
Yes you can do this with webhooks.
Typically, you would save the status of the order in your db, then you could have an intent that would:
Understand the query of your user (Is my pizza order confirmed)
The intent would call your webhook
the webhook would return the status order.
Api.ai would then give the answer.
When you use webhooks you need to return the speech response, the displayText, optionally the data that your apps need, the contextOut and the source.
I guess you would also need to have implement some context in api.ai so that you could now who is asking about the satus of the order. You would then be able to use the sessionId
Matt is correct here. You must use a webhook. Unfortunately the documentation from API.AI is currently very poor. Here's a screenshot example of an incoming post request. My message function will return an object with a desired response. In this case, I am using a Telegram chat bot. If you are not using any messenger, you can drop the data key: value. FollowupEvent is also optional.
Node.JS code with Restify
On your API.AI intent, make sure to check off Webhook. If you end getting the text response 'Broken' here, then something went wrong and you should check your error codes.
API.AI intent
And lastly, under the fulfillment tab, make sure to enable the webhook and point it at the right endpoint.

Resources