Модуль 'dialogflow_v2.types' не имеет члена 'QueryInput' - PullRequest
0 голосов
/ 07 июня 2019

Я пытался вызвать api диалогового потока, используя python, но получаю сообщение об ошибке, так как "Module 'dialogflow_v2.types" не имеет элемента "QueryInput" ", пожалуйста, помогите мне.

import dialogflow

defdetect_intent_texts (project_id, session_id, тексты, 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")

1 Ответ

0 голосов
/ 09 июня 2019

Эта ошибка возникает из-за пакета линтера, называемого pylint. Вы можете просто удалить его, набрав:

    pip uninstall pylint 
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...