【问题标题】:End Google Assistant Conversation结束 Google 助理对话
【发布时间】:2021-01-27 16:46:34
【问题描述】:

我有一个通过 Webhook 与 Google 助理通信的应用程序。当用户提出要求时,我的应用程序会将问题发送给 AI (Watson IBM)。得到响应后,我想将其展示给用户并结束对话。所以我从 Watson 和 nextSecene =actions.scene.END_CONVERSATION 发送了一条短信。但是 Google 助理只是结束了对话,而不向用户显示响应。那么是否可以向用户显示响应消息然后结束对话?

我的应用 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) ...)

【问题讨论】:

    标签: actions-on-google


    【解决方案1】:

    是的,这是可能的。

    我不确定您使用哪个库来生成响应 json,但下面是一个提供语音和文本数据并结束对话的示例。您可以在 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"
        }
      }
    }
    

    如果您对使用 Assistant Conversation 库感兴趣,请查看 this link 以查看示例响应

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多