简体   繁体   English

结束 Google 助理对话

[英]End Google Assistant Conversation

I have an application that communicates with Google Assistant via Webhook.我有一个通过 Webhook 与 Google Assistant 通信的应用程序。 When a user asks for something, my app sends the question to AI (Watson IBM).当用户提出要求时,我的应用程序会将问题发送给 AI (Watson IBM)。 After it gets the response, I want to show it to the user and end the conversation.得到响应后,我想将其显示给用户并结束对话。 So I send a text from Watson and nextSecene =actions.scene.END_CONVERSATION .所以我从 Watson 和nextSecene =actions.scene.END_CONVERSATION发送了一条文本。 But Google Assistant just ends the conversation without showing the response to user.但 Google Assistant 只是结束了对话,没有向用户显示回复。 So is it possible to show the response message to the user and than end the conversation?那么是否可以向用户显示响应消息而不是结束对话?

Example of my app JSON format response :我的应用 JSON 格式响应示例

GAResponse(prompt=GAPrompt(override=false, firstSimple=GAFirstSimple(speech=<speak>You are very smart bro,y<break time="100ms"/> and i love monsters like you.</speak>, text=You are very smart bro and i love monsters like you), content=null, lastSimple=null, link=null, canvas=null, orderUpdate=null), scene=GAScene(name=null, slotFillingStatus=null, slots=null, next=actions.scene.END_CONVERSATION) ...)

Yes this is possible.是的,这是可能的。

I'm not sure which library your using to generate your response json, but below is an example that provides the speech and text data and ends the conversation.我不确定您使用哪个库来生成响应 json,但下面是一个提供语音和文本数据并结束对话的示例。 You can learn more on the fulfillment (aka webhook) on the reference documentation您可以在参考文档中了解有关实现(又名 webhook)的更多信息

{
  "session": {
    "id": "example_session_id",
    "params": {}
  },
  "prompt": {
    "override": false,
    "firstSimple": {
      "speech": "<speak>You are very smart bro, <break time="100ms"/> and i love monsters like you.</speak>",
      "text": "You are very smart bro and i love monsters like you"
    }
  },
  "scene": {
    "name": "SceneName",
    "slots": {},
    "next": {
      "name": "actions.scene.END_CONVERSATION"
    }
  }
}

If you're interested in using Assistant Conversation libraray, check out this link to see an example response如果您有兴趣使用 Assistant Conversation 库,请查看此链接以查看示例响应

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM