gpt4 book ai didi

dialogflow-es - DialogFlow : simple ways of passing parameters between intents and from previous context to the current context?(不使用填充)

转载 作者:行者123 更新时间:2023-12-03 08:16:48 25 4
gpt4 key购买 nike

您好,我正在寻找在意图和上下文之间传递值的简单解决方案。

我尝试为意图 A 设置输出上下文 (c1),并使用 c1 作为意图 B 的输入上下文。但是,我无法访问意图 B 中的参数值。我是否必须使用 fullfillment来实现这个?

另外,我还想在下次触发intent A时,使用intent A之前的参数值。同样,我们可以在不使用fulfillment的情况下做到这一点吗?

如果必须满足要求,您能否提供一些指导?

最佳答案

可以从控制台本身访问从一个意图到另一个使用上下文的意图的参数值。也可以使用 Fulfillment Webhook 响应,但对于您的用例,这可以从控制台本身完成。

您可以引用以下复制步骤:

  • 默认欢迎意图的文本响应中添加嗨,你叫什么名字?并添加输出上下文awaiting_name

enter image description here

  • 创建另一个意图获取名称,并在该意图中传递“awaiting_name”作为输入上下文。传递一些训练短语,例如“john,sandeep,jacob”,并将其映射到 @sys.given.name 实体。
  • 在“获取名称意图”中,文本响应为Ok $name,您的电子邮件地址是什么?。在此意图的输出上下文字段中添加 awaiting_email

enter image description here

enter image description here

  • 创建另一个意图“获取电子邮件”并在输入上下文中添加awaiting_email。添加训练短语,如“s [email protected]”、“[email protected]”,并将它们映射到 @sys.email 实体。

enter image description here

  • 当您想要从另一个意图获取参数值到使用上下文的当前意图时,您需要按照此 doc 通过 #context-name.parameter-name 调用它.
  • 我的最终输出响应是谢谢#awaiting_name.name,我们将很快通过 $email 与您联系

enter image description here

关于dialogflow-es - DialogFlow : simple ways of passing parameters between intents and from previous context to the current context?(不使用填充),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69124168/

25 4 0