我想从this tutorial创建一个聊天机器人,但似乎Rasa版本太旧了,突然命令不起作用 .
我知道如何通过Slack恢复和响应消息,但我不知道如何从我使用聊天界面开发的Web应用程序中执行此操作 .
使用Slack,我启动了以下脚本:
from rasa_core.channels import HttpInputChannel
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
#from rasa_slack_connector import SlackInput
nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/moodnlu')
agent = Agent.load('./models/dialogue',interpreter = nlu_interpreter)
# With Slack
# https://api.slack.com/apps/AASPDV196/oauth?
#input_channel = SlackInput('OAuth Access Token','Bot User OAuth Access Token', 'Verification Token',True)
#agent.handle_channel(HttpInputChannel(5004,'/',input_channel))
# With inner app
input_channel = SlackInput('OAuth Access Token','Bot User OAuth Access Token', 'Verification Token',True)
agent.handle_channel(HttpInputChannel(5000,'/',input_channel))
我知道我必须修改 input_channel 以便他在正确的端口听到,但我真的不知道如何 .
Here是HttpInputChannel的来源