How can I trigger dialogflow event from detect intent API?(如何从检测意图接口触发对话流事件?)
问题描述
如何从Python检测意图API触发对话流中的事件。 我希望在开始聊天窗口后立即触发欢迎意图。
欢迎
您需要将"推荐答案"事件作为查询输入的一部分发送给detect_intent()
的调用。它可能如下所示
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)
这篇关于如何从检测意图接口触发对话流事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!