zhayujie / chatgpt-on-wechat

基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择GPT3.5/GPT-4o/GPT-o1/ Claude/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Claude/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
https://docs.link-ai.tech/cow
MIT License
29.86k stars 7.88k forks source link

容器部署时,第三方镜像调用claude失败 #2159

Closed Pink9999 closed 1 month ago

Pink9999 commented 1 month ago

前置确认

⚠️ 搜索issues中是否已存在类似问题

操作系统类型?

Linux

运行的python版本是?

python 3.8

使用的chatgpt-on-wechat版本是?

Master (branch)

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

docker-compose.yml文件中想要生效bot_type:'chatGPT'一项却一直没法实现,是格式不对吗,如果不调用就会导致识别为claude_api格式,创建一个Claudebot,紧接着就不会有任何的响应

问题描述 😯

屏幕截图 2024-07-18 113830

屏幕截图 2024-07-18 113915

终端日志 📒

[INFO][2024-07-18 03:18:25][bridge.py:61] - create bot claudeAPI for chat
[INFO][2024-07-18 03:18:27][claude_api_bot.py:42] - [CLAUDE_API] query=你好
[WARNING][2024-07-18 03:18:33][claude_api_bot.py:116] - [CLAUDE_API] Exception: Error code: 403 - {'error': {'type': 'forbidden', 'message': 'Request not allowed'}}
[INFO][2024-07-18 03:18:33][claude_api_bot.py:54] - {'completion_tokens': 0, 'content': '我现在有点累了,等会再来吧'}
[ERROR][2024-07-18 03:18:33][chat_channel.py:303] - Worker return exception: 'total_tokens'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/channel/chat_channel.py", line 170, in _handle
    reply = self._generate_reply(context)
  File "/app/channel/chat_channel.py", line 193, in _generate_reply
    reply = super().build_reply_content(context.content, context)
  File "/app/channel/channel.py", line 38, in build_reply_content
    return Bridge().fetch_reply_content(query, context)
  File "/app/bridge/bridge.py", line 76, in fetch_reply_content
    return self.get_bot("chat").reply(query, context)
  File "/app/bot/claudeapi/claude_api_bot.py", line 56, in reply
    result["total_tokens"],
KeyError: 'total_tokens'
6vision commented 1 month ago

启动日志中是否有bot_type参数,修改配置需要先compose down再启动