zhayujie / chatgpt-on-wechat

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

docker部署接入fastgpt异常 #2104

Open xigexb opened 1 week ago

xigexb commented 1 week ago

前置确认

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

操作系统类型?

Linux

运行的python版本是?

python 3.10

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

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

我本地部署的fastgpt,配置的oneapi,模型配置的阿里通义千问max 这是docker-compose文件 version: '2.0' services: chatgpt-on-wechat: image: mirrors.ktthings.com:444/ktthings-docker/zhayujie/chatgpt-on-wechat container_name: chatgpt-on-wechat security_opt:

这里是日志

[INFO][2024-06-24 07:36:38][bridge.py:61] - create bot dashscope for chat chatgpt-on-wechat | [ERROR][2024-06-24 07:36:38][chat_channel.py:302] - Worker return exception: str expected, not NoneType chatgpt-on-wechat | Traceback (most recent call last): chatgpt-on-wechat | File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run chatgpt-on-wechat | result = self.fn(*self.args, **self.kwargs) chatgpt-on-wechat | File "/app/channel/chat_channel.py", line 169, in _handle chatgpt-on-wechat | reply = self._generate_reply(context) chatgpt-on-wechat | File "/app/channel/chat_channel.py", line 192, in _generate_reply chatgpt-on-wechat | reply = super().build_reply_content(context.content, context) chatgpt-on-wechat | File "/app/channel/channel.py", line 38, in build_reply_content chatgpt-on-wechat | return Bridge().fetch_reply_content(query, context) chatgpt-on-wechat | File "/app/bridge/bridge.py", line 76, in fetch_reply_content chatgpt-on-wechat | return self.get_bot("chat").reply(query, context) chatgpt-on-wechat | File "/app/bridge/bridge.py", line 67, in get_bot chatgpt-on-wechat | self.bots[typename] = create_bot(self.btype[typename]) chatgpt-on-wechat | File "/app/bot/bot_factory.py", line 55, in create_bot chatgpt-on-wechat | return DashscopeBot() chatgpt-on-wechat | File "/app/bot/dashscope/dashscope_bot.py", line 29, in init chatgpt-on-wechat | os.environ["DASHSCOPE_API_KEY"] = self.api_key chatgpt-on-wechat | File "/usr/local/lib/python3.10/os.py", line 685, in setitem chatgpt-on-wechat | value = self.encodevalue(value) chatgpt-on-wechat | File "/usr/local/lib/python3.10/os.py", line 757, in encode chatgpt-on-wechat | raise TypeError("str expected, not %s" % type(value).name) chatgpt-on-wechat | TypeError: str expected, not NoneType

问题描述 😯

接入fastgpt配置的时候发生异常,按照官方配置

终端日志 📒


<此处粘贴终端日志>
``` [INFO][2024-06-24 07:36:38][bridge.py:61] - create bot dashscope for chat
chatgpt-on-wechat  | [ERROR][2024-06-24 07:36:38][chat_channel.py:302] - Worker return exception: str expected, not NoneType
chatgpt-on-wechat  | Traceback (most recent call last):
chatgpt-on-wechat  |   File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
chatgpt-on-wechat  |     result = self.fn(*self.args, **self.kwargs)
chatgpt-on-wechat  |   File "/app/channel/chat_channel.py", line 169, in _handle
chatgpt-on-wechat  |     reply = self._generate_reply(context)
chatgpt-on-wechat  |   File "/app/channel/chat_channel.py", line 192, in _generate_reply
chatgpt-on-wechat  |     reply = super().build_reply_content(context.content, context)
chatgpt-on-wechat  |   File "/app/channel/channel.py", line 38, in build_reply_content
chatgpt-on-wechat  |     return Bridge().fetch_reply_content(query, context)
chatgpt-on-wechat  |   File "/app/bridge/bridge.py", line 76, in fetch_reply_content
chatgpt-on-wechat  |     return self.get_bot("chat").reply(query, context)
chatgpt-on-wechat  |   File "/app/bridge/bridge.py", line 67, in get_bot
chatgpt-on-wechat  |     self.bots[typename] = create_bot(self.btype[typename])
chatgpt-on-wechat  |   File "/app/bot/bot_factory.py", line 55, in create_bot
chatgpt-on-wechat  |     return DashscopeBot()
chatgpt-on-wechat  |   File "/app/bot/dashscope/dashscope_bot.py", line 29, in __init__
chatgpt-on-wechat  |     os.environ["DASHSCOPE_API_KEY"] = self.api_key
chatgpt-on-wechat  |   File "/usr/local/lib/python3.10/os.py", line 685, in __setitem__
chatgpt-on-wechat  |     value = self.encodevalue(value)
chatgpt-on-wechat  |   File "/usr/local/lib/python3.10/os.py", line 757, in encode
chatgpt-on-wechat  |     raise TypeError("str expected, not %s" % type(value).__name__)
chatgpt-on-wechat  | TypeError: str expected, not NoneType