- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
Rasa版本:Core = 0.14.4,Core-sdk = 0.14.0,NLU = 0.15.0
Python版本:3.6.7
操作系统(windows、osx...):Ubuntu 18.04.2 LTS
问题:我一直在使用 Rasa Stack 入门包 ( https://github.com/RasaHQ/starter-pack-rasa-stack ),除了我将 python 实例更改为 python3 的 Makefile 之外,其中的文件保持不变。我尝试使用 RestInput channel 让 Rasa Stack 作为服务器工作,如 https://rasa.com/docs/core/connectors/#rest-channels 中所述。 。我使用示例通过运行脚本连接其余输入 channel :
python3 -m rasa_core.run -d models/current/dialogue -u models/current/nlu --port 5002 --credential credentials.yml
这最初有效,但我尝试使用以下代码发布消息:
import requests
URL = 'http://localhost:5010/webhooks/rest/webhook/'
PARAMS = {'sender': "ola", 'message': "how are you"}
r = requests.get(URL)
data = r.json()
print(data)
由于 url 超出最大重试次数和连接拒绝而导致错误。问题是从那时起,无论有没有命令行界面,我都无法启动并运行服务器。当我尝试按上述方式连接其余输入 channel 时,出现以下错误:
r/lib/python3.6/runpy.py:125: RuntimeWarning: 'rasa_core.run' found in sys.modules after import of package 'rasa_core', but prior to execution of 'rasa_core.run'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
2019-05-21 08:38:27 INFO root - Rasa process starting
2019-05-21 08:38:45 INFO rasa_nlu.components - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
Traceback (most recent call last):
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 355, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/connection.py", line 183, in connect
conn = self._new_conn()
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f58af883ba8>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thales/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/thales/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=5002): Max retries exceeded with url: /webhooks/rest/webhook/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f58af883ba8>: Failed to establish a new connection: [Errno 111] Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/dist-packages/rasa_core/run.py", line 204, in <module>
endpoints=_endpoints)
File "/usr/local/lib/python3.6/dist-packages/rasa_core/run.py", line 157, in load_agent
from rasa_core import agent
File "/usr/local/lib/python3.6/dist-packages/rasa_core/agent.py", line 14, in <module>
from rasa_core.channels import UserMessage, OutputChannel, InputChannel
File "/usr/local/lib/python3.6/dist-packages/rasa_core/channels/__init__.py", line 23, in <module>
from rasa_core.channels.telegram import TelegramInput # nopep8
File "/usr/local/lib/python3.6/dist-packages/rasa_core/channels/telegram.py", line 4, in <module>
from telegram import (
File "/home/thales/.local/lib/python3.6/site-packages/telegram/__init__.py", line 46, in <module>
from .files.file import File
File "/home/thales/.local/lib/python3.6/site-packages/telegram/files/file.py", line 23, in <module>
from future.backports.urllib import parse as urllib_parse
File "/home/thales/.local/lib/python3.6/site-packages/future/backports/__init__.py", line 14, in <module>
import_top_level_modules()
File "/home/thales/.local/lib/python3.6/site-packages/future/standard_library/__init__.py", line 810, in import_top_level_modules
with exclude_local_folder_imports(*TOP_LEVEL_MODULES):
File "/home/thales/.local/lib/python3.6/site-packages/future/standard_library/__init__.py", line 781, in __enter__
module = __import__(m, level=0)
File "/home/thales/ola/starter-pack-rasa-stack/test.py", line 6, in <module>
r = requests.post(URL, data = PARAMS)
File "/home/thales/.local/lib/python3.6/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/thales/.local/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/home/thales/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/thales/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/thales/.local/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5002): Max retries exceeded with url: /webhooks/rest/webhook/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f58af883ba8>: Failed to establish a new connection: [Errno 111] Connection refused',))
提到端口的错误部分似乎取决于我的帖子消息 python 脚本中的端口。命令行参数中的端口似乎被忽略。我尝试调试 run.py 文件,发现它在第 157 行“来自 rasa_core import agent”处崩溃了,这没有什么意义,因为该导入在 python 终端中可以正常工作。
“make cmdline”命令会产生与“make train-core”命令相同的错误。
我应该注意,我仍然可以为其他事情创建操作服务器和本地服务器。
配置文件(config.yml)的内容:
language: "en"
pipeline: spacy_sklearn
最佳答案
您提供的电报凭据似乎有误。请查看文档here如果您错过了什么。
如果您使用包含 localhost
的 URL 指定 Webhook URL:如果 Telegram 尝试将用户消息转发到机器人,则可以访问此 URL,因为此 URL 是内部的。你可以例如使用ngrok使该网址公开。
关于python - 运行 Rasa Stack 时超出最大重试次数并出现连接拒绝错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56234533/
是否可以重试网络客户端请求?在奇怪的情况下,我的应用程序在尝试连接到 xml Web 服务时会抛出错误,但如果我重试,它就可以正常工作。我希望它在抛出错误之前重试 2 次,除非有人有更好的解决方案:)
我在一本书中找到了这段代码片段: int ival; // read cin and test only for EOF; loop is executed even if there are oth
是否可以使用 for lop 来设置对象的条件。如果该条件未通过测试(if 语句),则更改条件直到它通过测试?这是我的伪代码尝试,但我怀疑它是否有效: for (int i = 0; i < myAr
我有以下问题。我的主要 Activity 由一个 ListView 组成,其中填充了从 Web 服务获得的数据。首次加载主要 Activity 时,以防无法从网络检索数据,我想显示一个带有 2 个按钮
我有微服务应用程序。为了协作,每个服务都使用异步消息传递。我知道,spring data jpa 默认使用乐观锁。但是如果这种锁定不是由用户调用,而是由另一个服务调用的方法(在我的示例中有验证服务,可
我希望能够在 F# 中编写一个计算表达式,如果它抛出异常,它将能够重试操作。现在我的代码看起来像: let x = retry (fun() -> GetResourceX()) let y = re
是否可以在 NServiceBus 版本 3.2.2 中禁用重试? 使用以下配置,可以禁用重试: 但当线程数设置为 20 时则不会。在这种情况下,消息会重试两次: 这看起来很像
我在 failed_jobs 上有多个失败的作业。我尝试重新排队 MaxAttemptsExceededException 但总是失败。如何重试那里的工作类型? 注意:每次我通过 php artisa
下面的 sproc 尝试向表中插入一行并生成一个随机 ID,用于在相应表上进行 PK。与随机生成的 ID 的冲突在 catch 块中处理,在那里再次重试/调用该过程。现在,这需要很长时间并导致死锁,因
我试图实现代码以使用“mocha-retry”重试失败的测试以下是示例。 describe(retries,' retries-',function () { var self = this;
我正在尝试通过 Azure 数据工厂将数据从 Azure 数据湖存储插入到 Azure 表。 Azure Data Lake 文件中的数据与最终 Azure 表接收器的架构相同。 ADF 管道包含从
是http.RoundTripper在 Go 中基于 HTTP 状态代码(例如 429)实现 http GET 请求重试机制的正确位置? 它在某种程度上“感觉正确”( Go Playground )并
使用 spring reactive WebClient,我使用了一个 API,如果响应状态为 500,我需要使用指数退避重试。但是在 Mono 类中,我没有看到任何以 Predicate 作为输入参
我一直在尝试编写 react native 的快速入门指南,但一直收到此错误 There appears to be trouble with your network connection. Ret
我正在尝试使用从我们心爱的堆栈溢出中获取的 Retry Monad: type RetryBuilder(max, sleep : TimeSpan) = member x.Return(
使用 spring reactive WebClient,我使用了一个 API,如果响应状态为 500,我需要使用指数退避重试。但是在 Mono 类中,我没有看到任何以 Predicate 作为输入参
我有一个由 C#.NET 4.0 开发的两层 Windows 窗体应用程序。在这个应用程序中,我读取文件内容并在数据访问层中创建实体列表,并将其返回到 GUI 层以在 GridView 中显示。在我当
如果有人问过这个问题,我深表歉意,但我已经做了很多搜索,但还没有找到与我的问题类似的问题。 在我的应用程序中,我有一个密码更改页面,如果某人是新用户或重置了他/她的密码,该页面就会触发。 问题是,一旦
想知道为什么我的 promise 正在解决但试图重试。 var getResultsStream = url => Rx.Observable.onErrorResumeNext( Rx.O
假设我有以下 Promise 链: var result = Promise.resolve(filename) .then(unpackDataFromFile) .then(tra
我是一名优秀的程序员,十分优秀!