python监听端口接收的数据_如何监听特定端口的数据?

我想从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的来源

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值