首页 > 解决方案 > 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.

标签: google-cloud-platformdialogflow-esactions-on-google

解决方案


我最终直接向 DialogFlow Support 发送消息并收到了回复,所以我想我会在这里分享:

不幸的是,到目前为止,Dialogflow 不支持 AoG 深度链接调用上的会话实体类型。目前,会话实体在会话开始后加载。

看起来是不可能的。


推荐阅读