我想从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的来源
如果您已经准备好对话模型和nlu模型,您可以像这样运行Rasa核心
然后在另一个终端中,执行下面的操作,您将得到一个响应
^{pr2}$如果发送方id对您很重要,那么如果您想将
nad
作为发送方id传递,请使用下面的命令适用于NLU版本
0.12.3
和核心版本0.9.0a6
更新: 如果你想围绕它构建一个UI
在码头下面跑
在你的服务器上
这将在您的终端中输出
hello
的回复。在相关问题 更多 >
编程相关推荐