我正在尝试运行以下github项目:-
在main_dialog.py中,第(70-73)行是相关的:
# Call LUIS and gather any potential booking details. (Note the TurnContext has the response to the prompt.)
intent, luis_result = await LuisHelper.execute_luis_query(
self._luis_recognizer, step_context.context
)
使用Luis应用程序ID,密钥和主机名配置的config.py
[当我运行python应用程序时:-python app.py
并启动chatbot模拟器,它无法识别LUIS意图,并且我也遇到错误。
错误的更多描述,我在下面的链接中提供了:
Chatbot v4 issue raised github
复制步骤:使用Luis应用程序ID,密钥和主机配置config.py。使用python app.py运行应用启动chatbot模拟器,并使用http://localhost:3978/api/messages网址打开bot。根据屏幕截图输入您的消息。
案例1. Luis主机ID配置为以https://开头的值,即config.py中的https://XXXX.XXXX.XXX
发生吹气错误:请求中发生错误。,ConnectionError:HTTPSConnectionPool(host ='https',端口= 443):URL超过了最大重试次数:/southcXXX.api.XXXXX.microsoft.com/luis/v2.0/apps /?log = true(由NewConnectionError('引起:无法建立新的连接:[Errno 11001] getaddrinfo失败'))
情况2。当luis主机配置为不带https://时,即XXXX.XXXX.XXXX
然后在main_dialog.py中无法识别luis意图。终于到了didt_understand_message部分,即抱歉,我没明白。请尝试在chatbot中以其他方式提问(如屏幕快照所示)
# Call LUIS and gather any potential booking details. (Note the TurnContext has the response to the prompt.)
intent, luis_result = await LuisHelper.execute_luis_query(
self._luis_recognizer, step_context.context
)
if intent == Intent.BOOK_FLIGHT.value and luis_result:
# Show a warning for Origin and Destination if we can't resolve them.
await MainDialog._show_warning_for_unsupported_cities(
step_context.context, luis_result
)
# Run the BookingDialog giving it whatever details we have from the LUIS call.
return await step_context.begin_dialog(self._booking_dialog_id, luis_result)
if intent == Intent.GET_WEATHER.value:
get_weather_text = "TODO: get weather flow here"
get_weather_message = MessageFactory.text(
get_weather_text, get_weather_text, InputHints.ignoring_input
)
await step_context.context.send_activity(get_weather_message)
else:
didnt_understand_text = (
"Sorry, I didn't get that. Please try asking in a different way"
)
didnt_understand_message = MessageFactory.text(
didnt_understand_text, didnt_understand_text, InputHints.ignoring_input
)
await step_context.context.send_activity(didnt_understand_message)
return await step_context.next(None)
请帮助。在此先感谢。
此问题已解决。Luis主机格式已添加到config.py文件中,该文件具有https://,这引起了问题。我只是从url中删除了它,对我来说效果很好。
https://xxx.xxx.xxx-该Python项目的格式错误。xxxx.xxxx.xxx-正确的格式。