【发布时间】:2019-06-07 06:51:41
【问题描述】:
我尝试使用 python 调用 dialogflow api,但出现错误
模块“dialogflow_v2.types”没有“QueryInput”成员
请帮帮我。
import dialogflow
def detect_intent_texts(project_id, session_id, texts, language_code):
session_client = dialogflow.SessionsClient()
session = session_client.session_path(project_id, session_id)
print('Session path: {}\n'.format(session))
for text in texts:
text_input = dialogflow.types.TextInput(text=text, language_code=language_code)
query_input = dialogflow.types.QueryInput(text=text_input)
response = session_client.detect_intent(session=session, query_input=query_input)
print('Fulfillment text: {}\n'.format(response.query_result.fulfillment_text))
detect_intent_texts("upcl-b0ba9","abcd",["hello"],"en-US")
【问题讨论】:
-
这个问题有什么更新吗?我也面临同样的问题。
标签: python dialogflow-es