-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event loop is closed #65
Comments
调用百度样例会出现,智谱没有出现 agent_factory\.set_settings("current_model", "ERNIE")\.set_settings("model.ERNIE.auth", {"aistudio": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",})agent = agent_factory.create_agent() result = ( |
已经关注到这个问题,因为不是必定出现,正在排查出现的时机 |
我这边也出现了这个问题,使用的是本地部署的 OpenAI 接口的模型,另外,使用 Yi34B 的 API 也会出现此问题。 |
请问是每次请求都会出现吗 |
调用全局工具的时候,几乎都是稳定会触发的 |
可能找到了一个相关问题,请问这个全局工具本身是不是异步的? |
我在Agently 3.2.2.3版本修正了一些异步的问题,目前本地使用PyCharm 3.9环境下调用相同的代码,或是使用浏览器或者搜索工具,目前都没有遇到Event loop is closed的情况。 可以更新至3.2.2.3再试试 |
不是的,我这边没有做异步处理,是否和这个有关系呢 |
我处理了一些涉及异步调用未等待的问题,可以更新到3.2.2.3版本再试试 |
Agently.AgentFactory().set_settings("current_model", "OpenAI").set_settings("model.OpenAI.auth", { "api_key": "" }).set_settings("model.OpenAI.url", "https://api.moonshot.cn/v1").set_settings("model.OpenAI.options", { "model": "moonshot-v1-8k" }) 我用kimi 也很容易触发这个问题
|
进展:根据目前的反馈,怀疑是OpenAI客户端对其他模型的适配存在问题,正在考虑用httpx请求替换掉对OAI客户端的依赖 |
部分测试显示nest_asyncio引入有效果,会在后续版本引入进包 |
已经将nest_asyncio引入框架内,无需额外设置,自动启用 应该会极大降低event loop is closed的概率 |
因为nest_asyncio和Gradio有冲突,只能从框架中移出 目前定位到event loop is closed错误很可能是OpenAI客户端的问题,使用pip install -U OpenAI升级到最新版就好 也可以自行引入nest_asyncio降低这个错误出现的概率 |
This bug still happen time to time so I remove the But this bug seems have no harm to your process and will not break or stop the process except the annoying console error report... |
还是不行,依旧有这样的错误 |
是的,我还在查看问题具体的位置,同时也在改写请求核心,期望后续重构后的大版本更新能解决这个问题 |
update in efd937a wait to see if this issue can be solved or not. |
updated in 81242f4 local test shows no 'event loop is close' error any more. please use |
related issue from httpx: encode/httpx#2959 |
pycharm中执行样例总是报线程问题,这个异步是否需要优化一下
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x000001B09421C4C0>
Traceback (most recent call last):
File "D:\Python\Python39\lib\asyncio\proactor_events.py", line 116, in del
self.close()
File "D:\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "D:\Python\Python39\lib\asyncio\base_events.py", line 751, in call_soon
self._check_closed()
File "D:\Python\Python39\lib\asyncio\base_events.py", line 515, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
The text was updated successfully, but these errors were encountered: