Is there an API exposed for Actions on Google, similar to what Dialogflow offers with their API? The only API-like flow I have found through my research is this webhook flow API, but that only deals with conversation requests, prompts, and responses, which I have already handled.
Ideally I'd like to be able to dynamically create "agents" and their conversation flows without having to use the AoG console, similar to what Amazon offers with Alexa SMAPI.
There's not a full API to do everything that you want end-to-end. Some parts, like Dialogflow and fulfillment, can be automated, but it will still require some manual work in the Actions Console.
I had a conversation with another developer on this subject once. As a workaround, which is admittedly hacky, they decided to use the Puppeteer library to programmatically control a browser instance to fill in fields and click buttons.
That may not necessarily work when the console changes, and isn't a good substitute for an API, but it may work for you.
Yes you can do it using Google Dialogflow REST API
Here are APIs for the agent :
There are many more APIs available for different operations.
Related
I want to use Dialogflow fulfillment to connect to an external webservice / API. One way of doing that is to use the custom webhook feature (not the inline web hook). However, when using the custom web hook it seems that you are limited to creating just one even though you may have many intents and you may want to call many endpoints. Is there a way to link to more custom webhooks (API endpoints)?
If you can only set up one web hook then your webserivce will always receive a Post request from Dialogflow and will then need to interpret the body of the request i.e. based on the intent parameter. Just wondering is there a better way to work with REST webservices with Dialogflow.
The other potential option is to use the inline web hook and then put logic in there to call specific endpoints, however, that might get a bit messy.
You can only setup one fulfillment that will handle the processing for all the Intents you've enabled. This can be either the built-in one through the fulfillment editor or at a webhook URL you specify.
That webhook is expected to delegate the actual processing to an Intent Handler of some sort. The Dialogflow node.js fulfillment library has a way to register what handler you want for each Intent name, or you can switch on the Intent name, the Action name, or any other field provided to you in your code.
In the library, you'll typically make the REST calls from an appropriate Intent handler which will take the parameters provided and craft the call. If you are using Javascript, make sure you are handling the call asynchronously and return a Promise.
I recommend a webhook because it gives you more control than the inline editor does. The inline editor is really just a webhook under the covers using Firebase Cloud Functions. Even putting it yourself in a Cloud Function gives you better control over it.
There may be costs depending where you host it, however Firebase has a free tier that is sufficient for testing and light operation. Once your Action is published, you are also eligible for a monthly cloud credit from Google.
I am trying to integrate with google assistant/google home using Dialogflow and we are hitting some issues.
The issue is the following.
I have a google actions project that I have created which is linked to a corresponding dialogflow project. I have enabled the v2 APIs on both the dialogflow project and the integration of the dialogflow project and the google actions project.
The dialogflow project has intents that call a webhook for fulfillment. We have a service setup that responds to the webhook APIs. This service returns responses in V2 format including rich messages (like card, quick_replies, and carousel_select) under the key fulfillmentMessages:
However it appears that when dialogflow forwards this information to the google actions, it is not passing any of this information. On the other hand if I include a key called fulfillMentText in my service response, then dialogflow will forward that information to google actions as
[{"simpleResponse":{"textToSpeech":"Nice to meet you, Bob!"}}]}
It is not clear to me based on reading available docs, what I need to do so that dialogflow will also propagate the contents of fulfillmentMessages to google actions.
Thank you in advance.
The message objects for Actions on Google are different than the generic ones available for the other platforms Dialogflow supports. You need to also send the Actions on Google compatible messages in order to have them visible for the Assistant.
If you're using the dialogflow-fulfillment library, you can import the actions-on-google objects and add them to to the response and the library will handle them.
Don't worry about mixing the rich media types - only those that are appropriate for each platform will show.
I have built a chatbot having NLP and AI features in Java language. I have built restful webservices for interaction with the chatbot's AI engine.
The rest API will send the user's query and in return will get an answer by the bot.
I want to integrate this chatbot with Skype. As in there should be a chatbot account and then whenever a person types their query, it should be sent to my server via rest api call and then in turn the response message should be shown in skype chat window.
In my findings, I have seen skype integration with bots built bu Microsoft Bot Framework. Can anyone suggest how can I integrate this custom bot.
If anybody feels I haven't added right tags to reach the exact audience, please add the tags.
I think you need to create a MS Chatbot (in Azure) which allows to deploy it on Skype (and other channels ie Teams), then define a WebHook to invoke your service.
This service needs to "speak" with the MS Bot framework, so you will need to serialise/deserialise the payload, but in the backend you existing endpoint can be used as you need.
Hope it helps.
I am trying to forward Google Smart Home events to my Dialogflow fulfillment service. I am creating 3 intents with no input or output contexts set, no training phases and with the following events:
action_devices_SYNC
action_devices_EXECUTE
action_devices_QUERY
See also https://imgur.com/a/4eN9S.
Is that correct? I can't find confirmation in the docs, so that's why I am asking it here.
reasoning
The reason why I asked about connecting Google Smart Home with my Dialogflow endpoint is that I already have that endpoint in place. I hoped I could do something similar as in https://stackoverflow.com/a/49119822/9038652, where I bound a Dialogflow intent to the actions_intent_OPTION event.
There isn't a reason to use Dialogflow to do smart home fulfillment, and it's actually not possible.
Dialogflow is great for taking unstructured user utterances and making sense of them. However, with smart home, Google handles all of the NLU and parsing. You, as the integration, will just receive a JSON request and will be expected to provide a JSON response.
So you will skip using Dialogflow and instead just build your webhook to parse the intents and give a valid response.
Dialogflow's service does not have a way to take in an intent name and expose a single endpoint URL that can be called by the Google Assistant. It also does not have integration with an OAuth server to do the account linking step.
I started writing a dialogflow fulfillment extending https://dialogflow.com/docs/getting-started/basic-fulfillment-conversation. They don't use DialogflowApp and just call response.json().
However, I also found https://developers.google.com/actions/reference/nodejs/DialogflowApp where fulfillment is done with the DialogflowApp.
When do you use each? and why does the Dialogflow Key Concepts and Basic Fulfillment document not mention to DialogflowApp at all?
The first route (sending response directly) doesn't seem to have a way to deal with permissions and push/daily notifications, while DialogflowApp does.
Will the documentation for sending responses directly be extended to handle permissions? What is the best practice?
Thanks.
If you're using Actions on Google, go with the Actions on Google client library and DialogflowApp. This only supports Actions on Google.
If you are using other integrations that work with Dialogflow, such as Slack, then you should use the fulfillment library and documentation provided by Dialogflow.