Is there a way to end Google Home's conversation with the server using API.AI?
I am assuming that somehow I need to access expect_user_response and set it to false.
I also see with the actions SDK you can use 'assistant.tell()', but that does not seem accessible with API.AI.
For people that are not using the SDK. There are two ways that I found to stop the mic on Google Home while using API.AI.
In the "Intent" pane, under fulfillment, there is an "Actions on Google" section that you can expand. Under that you will see "End Conversation" check box. Check that box.
In your fulfillment include the following:
data: {
google: {
expect_user_response: false,
}
}
Add this at the same level as your speech property in your response.
Yes, you can. In your app, write a function that sends the query "stop" to your agent.
function stop_conversation(){ var api_request = new Request('https://api.api.ai/v1/query?v=20150910', {
method: 'POST',
mode: 'cors',
redirect: 'follow',
headers: {
'Authorization': 'Bearer 21f6a5778d484870ad46be4d34ac2eeb',
'content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify({
q: 'stop',
lang: 'en',
sessionId: '44628d21-d7a4-47d5-b1c6-a7f851be65fv'
})
});
}
If you're using the fulfillment library then invoke Assist('stop');
.
...
In the "Intent" pane, under fulfillment, there is an "Actions on Google" section that you can expand. Under that, you will see "End Conversation" check that box.
In your fulfillment include the following:
data: {
google: {
expect_user_response: false,
}
}
Add this at the same level as your speech property in your response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With