简体   繁体   English

将现有的自定义聊天机器人移植为Google Assistant操作

[英]Port existing custom chatbot as Google Assistant action

We have a framework that implements chatbot / voice assistant logic for handling complex conversations in the health domain. 我们有一个框架,该框架实现了聊天机器人/语音助手逻辑,用于处理健康域中的复杂对话。 Everything is implemented on our server side. 一切都在我们的服务器端实现。 This gives us full control of how responses are generated. 这使我们可以完全控制响应的生成方式。

The channel (such as Alexa or Facebook Messenger cloud) calls our webhook: 该频道(例如Alexa或Facebook Messenger云)调用了我们的Webhook:

  • When user messages, the platform sends these to our webhook: hashed user id, message text (chat message or transcribed voice) 当用户发送消息时,平台将这些消息发送到我们的网络挂钩:散列的用户ID,消息文本(聊天消息或转录的语音)
  • Our webhook responds with the appropriately structured response, which includes text to be displayed, spoken, possibly choice buttons and some images etc. It also includes a flag whether the current session has finished or user input is expected. 我们的webhook以适当的结构化响应进行响应,其中包括要显示的文本,语音,可能的选择按钮以及一些图像等。它还包含一个标志,指示当前会话是否已完成或是否需要用户输入。

Integrating a new channel involves conversion of the response returned into the form expected by a channel and setting some flags (has voice, has display etc.). 集成新通道涉及将返回的响应转换为通道期望的形式,并设置一些标志(有声音,有显示等)。

This simple framework has worked so far for Facebook Messenger, Cortana, Alexa (a little bit of hacking was needed to abandon it's intent and slot recognition), our web chatbot . 到目前为止,这个简单的框架已对我们的Web聊天机器人 Facebook Messenger,Cortana,Alexa(需要一点点黑客手段以放弃其意图和插槽识别) 起作用

We wanted to write a thin layer of support for Google Assistant action. 我们想为Google Assistant行为提供薄薄的支持。

Is there any way of passing all the input from Assistant user intact into a webhook such as the one described above and taking full control of the way responses are generated and the end of conversation is determined? 有什么方法可以将来自助手用户的所有输入完整地传递到上述的Webhook中,并完全控制生成响应和确定对话结束的方式?

I'd rather not delve into those cumbersome ways of API.AI of structuring a conversation which seems good for a trivial scenarios such as ordering an Uber but seems very bad for longer conversation. 我不想钻研那些麻烦的API.AI来构建对话,这对于一些普通的情况(例如订购Uber)似乎很有利,但对于较长的对话却似乎很不利。

Since you already have a Natural Language Understanding layer for your system, you don't need API.AI/Dialogflow, and you can skip this layer completely. 由于您的系统已经具有“自然语言理解”层,因此不需要API.AI/Dialogflow,可以完全跳过此层。 (The NLU is useful, even for large and extensive conversations, but doesn't make sense in your case where you've already defined the conversation through other means.) (即使对于大型和广泛的对话,NLU 很有用,但是对于已经通过其他方式定义对话的情况而言,NLU就没有意义了。)

You'll need to use the Actions SDK (sometimes known as actions.json after the configuration file it uses) to define triggering phrases, but after that you'll get all the text that the user says as part of your conversation through a webhook that delivers JSON to you. 您将需要使用Actions SDK (在其使用的配置文件后有时称为action.json)来定义触发短语,但是此后,您将通过Webhook获得用户在对话中所说的所有文本。为您提供JSON。 You'll reply with JSON that contains the text/audio response, images on cards, possibly suggestion chips, etc. 您将使用JSON进行回复,该JSON包含文本/音频响应,卡片上的图像,可能还有建议芯片等。

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

相关问题 无法在 web 模拟器上测试谷歌助手操作(错误云 function 部署失败。关闭) - unable to test google assistant action on web simulator (Error Cloud function deployment failed. Dismiss) Dialogflow 禁用 Google 助理 - Dialogflow disable Google Assistant dialogflow打开URL谷歌助手 - dialogflow opening URL google assistant 使用 google assistant/google home 自动打开 URL - automatically opening URL with google assistant/google home 如何在Google Assistant应用中关闭麦克风 - How to close mic in google assistant app Google Assistant(IFTTT)的Python HTTP POST / GET触发器 - Python HTTP POST/GET trigger for Google Assistant (IFTTT) 如何使用谷歌助手 IFTTT 发送网络钩子以不和谐 - How do I send a webhook to discord using google assistant IFTTT 来自 webhook 的 Google Assistant 响应无效:无法将 JSON 转换为 ExecuteHttpResponse - Google Assistant Invalid response from webhook: Failed to translate JSON to ExecuteHttpResponse 如何将帐户从后端服务器绑定到Google助手用户 - How to tie an account from a backend server to a google assistant user 尝试通过ifttt将Google Assistant集成到python中以学习和测试一些东西 - Trying to integrate google assistant to python via ifttt to learn and test some things
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM