简体   繁体   English

如何从检测意图 API 触发对话流事件?

[英]How can I trigger dialogflow event from detect intent API?

How can trigger event in dialogflow from python detect intent API.如何从 python 检测意图 API 在对话流中触发事件。 I want to trigger welcome intent as soon as I start my chat window.我想在启动聊天窗口后立即触发欢迎意图。

You'll need to send the "WELCOME" Event as part of the query input to the call to detect_intent() .您需要将“WELCOME”事件作为查询输入的一部分发送到调用detect_intent() It might look something like this它可能看起来像这样

import dialogflow

client = dialogflow.SessionsClient()

session = client.session_path('[PROJECT]', '[SESSION]')

event_input = dialogflow.types.EventInput(name='WELCOME', language_code='en-US')
query_input = dialogflow.types.QueryInput(event=event_input)
response = client.detect_intent(session=session, query_input=query_input)

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

相关问题 如何从 python 中的检测意图 API 测试对话流? - How can I test dialogflow from detect intent API in python? 在对话框流控制台内使用 Python 在对话框流中单击按钮时触发事件 [intent] - Trigger an event [intent] on button click in dialogflow using Python inside of a dialogflow console 如何通过点击而不是语音触发 Alexa 意图? - How can I trigger Alexa intent with clicks rather than voice? Dialogflow 按名称/路径而非输入触发意图 - Dialogflow trigger intent by name / path not by input dialogflow:: 同时检测意图和切换上下文 - dialogflow :: detect intent and switch context at the same time 如何从DialogFlow事件获取参数 - How to get parameters from DialogFlow Event 如何使用 Dialogflow_v2 Python 在 detect_intent 请求中添加 QueryParams? - How to add QueryParams in detect_intent request with Dialogflow_v2 Python? Python 中的 Dialogflow API 访问跟进意图 - Dialogflow API access follow up intent in Python 未知:无异常迭代请求! 尝试在 Dialogflow 中检测意图时 - Unknown: None Exception iterating requests! When trying to detect intent in Dialogflow 如何在 Python 中通过多处理触发一个事件两次 - How can I trigger an event twice in Python with multiprocessing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM