Google Home app with account linking option - dialogflow-es

I'm developing a google home speaker app using DialogFlow.
My scenarios is if a user signed in then the app shows user's specific information or if a user is not signed, it should show general information.
I filled account linking section (Linking type : OAuth)
(DialogFlow -> Integrations -> Google Assistant -> MANAGE ASSISTANT APP -> Account Linking)
I also unchecked "Sign in required" in the DialogFlow's Google assistant Integration option window.
My intent code is using conv.ask(), not conv.close()
But when I run test on the simulator
It shows it is not linked and you can set account with Google Home app, after that the conversation ends.
What I want to do is even if a user has not done account linking, the user can use the app.
(user sign in should be optional, not mandatory)
Any ideas?
Thanks.
EDITED
I am using "Default Welcome Intent" with "Enable webhook call for this intent" checked.
My Intent looks like this. It worked well before setting account Linking.
app.intent('Default Welcome Intent', conv => {
conv.ask('Welcome');
});
and my screenshot.
Screenshot of Actions on Google simulator
(sorry for none-English text in the screenshot. It tells it needs account linking and terminated the conversation. )
Here is the log message in Actions on Google simulator's debug tab.
{
"request": {
"response": "テスト用アプリ とリンクしていません。Google Home アプリからテスト用アプリ と Google アカウントをリンクできます。",
"expectUserResponse": false,
"conversationToken": "GidzaW11bG...",
...
"debugInfo": {
"sharedDebugInfoList": [
{
"name": "Account Linking Url",
"debugInfo": "https://gala-demo.appspot.com/app?login_hint=..." // removed sensitive information from the string
"subDebugEntryList": []
}
]
},
"visualResponse": {
"visualElementsList": [],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 0,
"is3pResponse": 1
},
"response": {
"response": "テスト用アプリ とリンクしていません。Google Home アプリからテスト用アプリ と Google アカウントをリンクできます。",
"expectUserResponse": false,
"conversationToken": "GidzaW11bG...",
"visualResponse": {
"visualElementsList": [],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 0,
"is3pResponse": 1
},
"debug": {
"sharedDebugInfoList": [
{
"name": "Account Linking Url",
"debugInfo": "https://gala-demo.appspot.com/app?login_hint=...", // removed sensitive information from the string
"subDebugEntryList": []
}
]
},
"errors": []
}

I found that when I run a simulator from integration menu in DialogFlow,
The simulator starts with old version which I set Sign-In Required.
And when I run a simulator from the Actions on Google TEST section, it starts with current setting (Sign-In Not Required).
You can check version from the simulator screen

Related

How to trigger action from Chip Suggestions in Dialog Flow?

I want to create a ChatBot where the user (mostly) selects from Chip Suggestions.
I can't understand how to construct the Chip Suggestions in Flask.
The following yields null:
#app.route('/webhook', methods=['POST'])
def webhook():
two_chips = jsonify(fulfillment_text="This message is from Dialogflow's testing!",
fulfillment_messages=[
{
"payload": {
"richContent": [
[
{
"type": "chips",
"options": [
{
"text": "HIV Testing Schedule",
"link": "https://example.com" #Links work, but I don't want links
},
{
"link": "https://example.com",
"text": "PreP"
}
]
}
]
]
}
}])
return two_chips
Ideally, the button clicking would trigger a new action/intent and the bot would respond with more specific text. I.e. what should I replace the link field with?
This link suggests that there is a replyMetadata field, but that seems to be specific to kommunicate, not Google?
I looked flask-dialogflow, but the documentation is too sparse and conflicting for me.
Those chips which require a link, should be replaced by a list 1. List items are clickable and trigger an intent via events 2 (to make the bot respond with more specific text).
To get started, update your code to use lists and then add the event name you'd like to trigger in your code. Then add that same event name to the Events section of the intent you want to trigger.
Here is an example of what that can look like. I tested a list and clicked on a list item to triggered a test event that ran my test intent:
Are you looking for suggestion chips like the one below?
The sample payload that you have shared is from Kommunicate [Disclaimer: I am founder #kommunicate] and it is specific to Kommunicate platform for link buttons. Seems like what you are looking for is direct buttons/suggestion chips, here is the right doc from Kommunicate for this: https://docs.kommunicate.io/docs/message-types#suggested-replies
As Kommunicate supports omnichannel and multiple platforms web, android, iOS, whatsapp, LINE, facebook, etc so Kommunicate supports its own rich message payload along with Dialogflow specific payload.
For Dialogflow specific suggestion chips, use:
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "These are suggestion chips."
}
},
{
"simpleResponse": {
"textToSpeech": "Which type of response would you like to see next?"
}
}
],
"suggestions": [
{
"title": "Suggestion 1"
},
{
"title": "Suggestion 2"
},
{
"title": "Suggestion 3"
}
],
"linkOutSuggestion": {
"destinationName": "Suggestion Link",
"url": "https://assistant.google.com/"
}
}
}
}
}
Source: https://developers.google.com/assistant/conversational/df-asdk/rich-responses#df-json-suggestion-chips

Chrome not add my custom search_provider on extension

I am creating an extension by adding my own search engine. I am the owner of all the domain already verified in Google Search Console. When I test on Development in Chrome, it doesn't override the search provider and it doesn't return any errors.
"chrome_settings_overrides": {
"homepage": "https://__MSG_domainExt__",
"search_provider": {
"name": "__MSG_searchExt__",
"search_url": "https://__MSG_domainExt__/#gsc.tab=0&gsc.q={searchTerms}&gsc.sort=",
"favicon_url": "https://__MSG_domainExt__/favicon.ico",
"encoding": "UTF-8",
"is_default": true
},
"startup_pages": [ "https://__MSG_domainExt__" ]
},

Unable to get the rich buttons to work on dialogflow. It returns Empty Response

So I have been trying to start off with creating chatbots on dialogflow. The issue I am running into is that my chatbot is meant to give users a bunch of options to select from and to take the conversation further from there. In order to implement that, I've used a suggestion chip I've included the JSON file that I am using. However, when testing, the bot detects the right intent but returns an empty response. I've included the code in case that helps.
{
"richContent": [
[
{
"options": [
{
"text": "Chip 1",
"image": {
"src": {
"rawUrl": "https://example.com/images/logo.png"
}
},
"link": "https://example.com"
},
{
"link": "https://example.com",
"text": "Chip 2",
"image": {
"src": {
"rawUrl": "https://example.com/images/logo.png"
}
}
}
],
"type": "chips"
}
]
]
}
If you are testing it in the console, you definitely won't get any response, since there is some issue with the way console works. Use dialogflow messenger to test it. Anyways in the actual production you won't be using simulator to test it. Dialogflow console is a simulator which has some capability restrictions but it will work when you use the messenger.

I would like to add one more conversation to actions.json

I have an application within watson assistant that consumes many services from other endpoints. and I would like to call this conversation (from watson) within a google assistant conversation in a certain intention. for example i will develop a rich conversation on google assistant and in one of the options i will call watson's conversation.
I tried as follows, but it didn't work. does anyone know any example that can help me?
{"locale": "pt-BR",
"actions": [
{
"description": "Launch intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "mainConversation"
},
"intent": {
"name": "actions.intent.MAIN"
}
},
{
"description": "Direct access",
"name": "BUY",
"fulfillment": {
"conversationName": "ExampleAction"
},
"intent": {
"name": "com.example.ExampleAction.BUY",
"trigger": {
"queryPatterns": [
"teste",
"azul",
"start"
]
}
}
}
],
"conversations": {
"mainConversation": {
"name": "mainConversation",
"url": "https://us-central1-ericanovo-798cc.cloudfunctions.net/webhook",
"fulfillmentApiVersion": 2
},
"BUY": {
"name": "ExampleAction",
"url": "https://orquestrador-sulamerica-teste.mybluemix.net/api/v1/chat/google?externaltoken=574213c0-e904-11e9-9970-ff484aa25334",
"fulfillmentApiVersion": 2
}
}
}
thanks
That won't work because the webhook for everything published under the same project has to be the same URL. You are expected to handle all the Intents and "actions" at that webhook.
In your case, you would also need to make sure the request is formatted the way the Watson API would be expecting it. The Assistant will send it using the Conversation Webhook Format, and it sounds like you would send it using Watson's Analyze Text API.
You're not showing any of your code, so it is difficult to be sure - but the first would be in a JSON format that you can extract. You can then use a library in Node (such as request-promise to make the calls to Watson. Based on the result from Watson, you'd need to format the results as a response and return it to the Assistant.
It isn't clear why you'd need multiple webhooks specifically, although it is certainly possible that some Intents may make different API calls than others.
Keep in mind that your custom Intents will only be valid on invocation. Subsequent Intents will all be TEXT Intents.

Why is nothing happening after I send a permission request body to dialogflow?

I want to use the Permission helper intent from dialogflow to get the users name. I have my webhook in C# that sends the following JSON request to dialogflow to do this:
https://github.com/dialogflow/fulfillment-webhook-json/blob/master/responses/v2/ActionsOnGoogle/AskForPermission.json
{
"payload": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"optContext": "To deliver your order",
"permissions": [
"NAME",
"DEVICE_PRECISE_LOCATION"
]
}
}
}
}
}
I also created the following intent:
But when I send this response to Dialogflow nothing happens, in the diagnostic info it does say 'Webhook execution successful' and i see my response coming in:
I thought i would be able to say yes or no as a response and then get the data in my next response objects from dialogflow under the property originalDetectIntentRequest
It looks like you're testing it through the Dialogflow "try it now" sidebar.
Permission requests require the Actions on Google Simulator, and only work for Actions on Google. You can click on the "See how it works in the Google Assistant" link that is also on the right side-bar to go to the simulator to test it.

Resources