google-cloud-platform - Initialize Session Entity Types before the first Intent response in Dialogflow with Google Assistant
问题描述
My app currently loads Session Entity Types during the Welcome Intent response.
So, if the user says:
Talk to TestPoemApp.
My app will respond:
Hi. What poem would you like to hear?
and also sends webhookResponse.SessionEntityTypes defining Session Entity Types for Entity "PoemType" (fulfillment method). The user can then say:
Recite My Custom Poem.
where "My Custom Poem" is a Session Entity Type for the Entity "PoemType". The RecitePoem Intent is fired and all works well.
However, if the user says:
Tell TestPoemApp to recite My Custom Poem. (a.k.a. UserPhrase2)
it does not work because the RecitePoem Intent is firing directly before the Session Entity Types have been loaded since the Welcome Intent was bypassed. Is there any way to load Session Entity Types before or during the first response?
NOTE 1: One thing I've tried is to use Events with server-side slot filling. So, when the user says UserPhrase2, the RecitePoem Intent sees that the required PoemType parameter is missing and responds with webhookResponse.SessionEntityTypes defining the Session Entity Types and also raises an Event which basically just retriggers the RecitePoem Intent. This does not work because I believe the webhookResponse.SessionEntityTypes is not read until the end of the Event chain (i.e. SessionEntityTypes won't be read until the retriggered RecitePoem call responds). I believe this because "When the followupEventInput parameter is set for a WebhookResponse, Dialogflow ignores the fulfillmentText, fulfillmentMessages, and payload fields." That doesn't specifically mention SessionEntityTypes, but I'm guessing those are also ignored.
NOTE 2: I could turn on "Allow automated expansion" for the Entity and sort of get around this, but I'd like to avoid this if possible because I believe actual, defined Session Entity Types will be better.
解决方案
我最终直接向 DialogFlow Support 发送消息并收到了回复,所以我想我会在这里分享:
不幸的是,到目前为止,Dialogflow 不支持 AoG 深度链接调用上的会话实体类型。目前,会话实体在会话开始后加载。
看起来是不可能的。
推荐阅读
- angular - 输入字符串 | null 不能分配给类型字符串?如何在 Angular 应用程序中解决这个问题?
- python - 无法从包含表格数据 (iframe) 的网站解析元素
- sql - 根据 periodtype 获取期间的开始日期
- java - 如何从java中的doc模板生成动态word文档?
- c# - 在 Linux 上使用 WinSCP .NET 程序集
- php - 使用 PHP 函数比较 MySQL 数据库中的数据
- sql - 使用子查询更新查询以标记重复项
- r - ggstatsplot 中的“提供的非有限值”
- python - openpyxl 从 Excel 文件中读取
- python - 树莓派 pygame 无法打开 image.PNG