A-kirami / nonebot-plugin-chatgpt

MIT License
319 stars 37 forks source link

[BUG]: 请求 ChatGPT 服务器时出现问题,请稍后再试 错误信息: AttributeError: 'NoneType' object has no attribute 'new_page' #100

Open jfz520 opened 1 year ago

jfz520 commented 1 year ago

报告清单

影响版本

v0.7.3

问题描述

请求 ChatGPT 服务器时出现问题,请稍后再试 错误信息: AttributeError: 'NoneType' object has no attribute 'new_page'

复现步骤

按照教程,我AT机器人问了“1+1”这个问题,然后机器人就回复请求 ChatGPT 服务器时出现问题,请稍后再试 错误信息: AttributeError: 'NoneType' object has no attribute 'new_page' 了 image

预期行为

No response

实际行为

No response

日志信息

No response

额外补充

No response

PrayerT commented 1 year ago

#80 (comment) 一样的问题,先看看那个吧

jfz520 commented 1 year ago

好的,已经解决了,但又出现了新问题:token过期

HAKURELING commented 1 year ago

请问一下怎么解决token过期的问题呢

Gakki-Loves commented 1 year ago

我也遇到了这个问题,请问您是怎么解决AttributeError: 'NoneType' object has no attribute 'new_page的?

sword280 commented 1 year ago

请问您是如何解决AttributeError: 'NoneType' object has no attribute 'new_page' 的呢?感谢

vafyl commented 1 year ago

同问咋个解决

Ikaros-521 commented 1 year ago

playwright install https://github.com/A-kirami/nonebot-plugin-chatgpt/issues/80

kawaiior commented 1 year ago

楼上给出了答案,playwright install,但是如果是缺少GLIBC_2.18同样会报这个错误,建议根据日志来判断具体情况

vafyl commented 1 year ago

我确实是缺少部分GLIBC导致的,根据报错日志缺啥,就解决啥就行了。

Passerby1011 commented 1 year ago

Running Matcher(type='message', module=nonebot_plugin_chatgpt.utils) failed. Traceback (most recent call last): File "/home/home/chat/bot.py", line 15, in nonebot.run() File "/home/home/venv/lib/python3.10/site-packages/nonebot/init.py", line 273, in run get_driver().run(*args, **kwargs) File "/home/home/venv/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 187, in run uvicorn.run( File "/home/home/venv/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run server.run() File "/home/home/venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/home/home/venv/lib/python3.10/site-packages/nonebot/message.py", line 141, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/home/home/venv/lib/python3.10/site-packages/nonebot/message.py", line 187, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/home/home/venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/home/home/venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run await handler( File "/home/home/venv/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(values) File "/home/home/venv/lib/python3.10/site-packages/nonebot_plugin_chatgpt/init.py", line 66, in ai_chat msg = await chat_bot(session[event]).get_chat_response(text) File "/home/home/venv/lib/python3.10/site-packages/nonebot_plugin_chatgpt/chatgpt.py", line 123, in get_chat_response async with self.get_page() as page: File "/usr/lib/python3.10/contextlib.py", line 199, in aenter return await anext(self.gen) File "/home/home/venv/lib/python3.10/site-packages/nonebot_plugin_chatgpt/chatgpt.py", line 115, in get_page page = await self.content.new_page() AttributeError: 'NoneType' object has no attribute 'new_page'