chatgpt-on-wechat
chatgpt-on-wechat copied to clipboard
发送文本后服务器端发生异常
[INFO][2023-03-16 12:26:19][chat_gpt_bot.py:28] - [OPEN_AI] query=你来自哪里 [ERROR][2023-03-16 12:26:19][wechat_channel.py:163] - module 'openai.error' has no attribute 'Timeout' Traceback (most recent call last): File "/app/chatgpt-on-wechat/bot/chatgpt/chat_gpt_bot.py", line 65, in reply_text response = openai.ChatCompletion.create( AttributeError: module 'openai' has no attribute 'ChatCompletion'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/app/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 159, in _do_send_text reply_text = super().build_reply_content(query, context) File "/app/chatgpt-on-wechat/channel/channel.py", line 31, in build_reply_content return Bridge().fetch_reply_content(query, context) File "/app/chatgpt-on-wechat/bridge/bridge.py", line 18, in fetch_reply_content return bot_factory.create_bot(bot_type).reply(query, context) File "/app/chatgpt-on-wechat/bot/chatgpt/chat_gpt_bot.py", line 47, in reply reply_content = self.reply_text(session, session_id, 0) File "/app/chatgpt-on-wechat/bot/chatgpt/chat_gpt_bot.py", line 92, in reply_text except openai.error.Timeout as e: AttributeError: module 'openai.error' has no attribute 'Timeout'
I met this error, too
两个问题:
- openai版本需要升级到 0.27.0
- 网络不通,参考 #351