A-kirami / nonebot-plugin-chatgpt

MIT License
319 stars 37 forks source link

[BUG]: 日志报告 f"非预期的响应内容: <r>HTTP{response.status}</r> {escape_tag(response.text)}" #108

Closed cjxzdzh closed 1 year ago

cjxzdzh commented 1 year ago

报告清单

影响版本

v0.7.3

问题描述

机器人无法正常回复。 日志报告 f"非预期的响应内容: HTTP{response.status} {escape_tag(response.text)}"

复现步骤

--更新至v0.7.3后,使用时忽然发生机器人无应答的情况,检查日志后发现如下情况

File "/home/zhenxun_bot/plugins/nonebot_plugin_chatgpt/init.py", line 66, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) │ │ │ └ '你好' │ │ └ PrivateMessageEvent(time=1675327330, self_id=315106773, post_type='message', sub_type='friend', user_id=100006497, message_ty... │ └ {'100006497': {'conversation_id': deque([None, None, None, None], maxlen=5), 'parent_id': deque(['bda32c79-3888-42b9-a799-6b3... └ <plugins.nonebot_plugin_chatgpt.chatgpt.Chatbot object at 0x7f9d44644220>

File "/home/zhenxun_bot/plugins/nonebot_plugin_chatgpt/chatgpt.py", line 172, in get_chat_response f"非预期的响应内容: HTTP{response.status} {escape_tag(response.text)}"

--注释掉line 172后再次运行,机器人侧得到应答

ChatGPT 服务器返回了非预期的内容: HTTP404 <bound method Response.text of <Response url='https://chat.openai.com/backend-api/conversation' request=>>

--尝试更换IP,使用代理,无法解决此问题。 --相同网络环境下,使用浏览器可以正常访问,排除token过期问题。

预期行为

No response

实际行为

No response

日志信息

No response

额外补充

No response

cjxzdzh commented 1 year ago

已经提供了pr