我们可以在Dialogflow中显示列表响应后触发简单响应吗?

问题描述 投票:1回答:2

[无论何时用户调用我的代理,它都会显示一个可供选择的选项的列表以及一个简单的响应,但是代理首先说出简单的响应,然后显示该列表

实际

user: Ok google talk to my test app.
bot: Welcome to my test app, Here's the list of options to select. (WELCOME MESSAGE)
     Please select your preference (RESPONSE)
     <list appears> (LIST)

预期

user: Ok google talk to my test app.
bot: Welcome to my test app, Here's the list of options to select. (WELCOME MESSAGE)
     <list appears> (LIST)
     Please select your preference. (RESPONSE)

助手是否有可能先说出欢迎信息,显示列表,然后在一定的延迟后说出响应?

dialogflow actions-on-google dialogflow-fulfillment
2个回答
1
投票

否,无法在列表后显示气泡。

当您在回复中添加列表时,口语文本将始终出现在列表之前。这主要是由于对话的语音/聊天部分与对话的视觉部分是分开的。即使在代码列表中添加响应后,丰富响应的显示也由Google控制。

示例:

enter image description here

conv.ask('This is a list example.'); // Create a list conv.ask(new List({ title: 'List Title', items: { 'SELECTION_KEY_ONE': { synonyms: [ 'synonym 1', 'synonym 2', 'synonym 3', ], title: 'Title of First List Item', description: 'This is a description of a list item.', image: new Image({ url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png', alt: 'Image alternate text', }), }, 'SELECTION_KEY_TWO': { synonyms: [ 'synonym 4', 'synonym 5', 'synonym 6', ], title: 'Title of Second List Item', description: 'This is a description of a list item.', image: new Image({ url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png', alt: 'Image alternate text', }), } } })); conv.ask("Please make your selection");

从您的示例的外观看来,您似乎试图在屏幕上向用户显示几个选项来控制对话,您确定Suggestion Chips不太适合吗?这些芯片旨在为用户提供选择,并且比列表更易于实现。

延迟发言,而不是气泡

如果您不想那样做,您可以做的是,通过SSML在语音文字中添加一个延迟,但这只会改变人们通过语音使用您的动作的体验。在手机上使用Google助手时,它不会更改气泡的显示位置。对于使用您的操作而没有屏幕的任何人,这可能会引起混乱,因为语音被延迟到一个列表中,因为它没有屏幕,所以永远不会在其设备上显示。

以语音为先的设计体验

通常,将谈话设计成仅围绕谈话的一部分进行语音是一种很好的做法。通过使对话依赖于列表,可以限制可以将操作部署到的平台数量。解决此问题的声音优先方法可能是为您的操作支持的每个选项创建意图,并通过诸如“我如何为您提供帮助”之类的通用消息来打开您的欢迎意图。并具有备用目的,可以通过说出他们可以使用的不同选项来帮助用户。可以与“建议筹码”结合使用,以仍然提供您所需的指导视觉效果。

实现起来需要做更多的工作,但是它确实使您的机器人在对话和它可以支持的平台上有更多的灵活性。


0
投票
将webhook添加到您的操作中,并使用Browsing Carousel JSON作为意图。在列表项之后添加simpleReponse节点,以在列表显示后添加响应。浏览轮播的示例JSON:

{ "payload": { "google": { "expectUserResponse": true, "richResponse": { "items": [ { "simpleResponse": { "textToSpeech": "Here's an example of a browsing carousel." } }, { "carouselBrowse": { "items": [ { "title": "Title of item 1", "openUrlAction": { "url": "https://example.com" }, "description": "Description of item 1", "footer": "Item 1 footer", "image": { "url": "https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png", "accessibilityText": "Image alternate text" } }, { "title": "Title of item 2", "openUrlAction": { "url": "https://example.com" }, "description": "Description of item 2", "footer": "Item 2 footer", "image": { "url": "https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png", "accessibilityText": "Image alternate text" } } ] } } ] } } } }

参考https://developers.google.com/assistant/conversational/rich-responses#df-json-basic-card
© www.soinside.com 2019 - 2024. All rights reserved.