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
30.3k stars 7.97k forks source link

Kimi无法正常回应,显示can only concatenate str (not "NoneType") to st #2058

Closed sssssSleep closed 3 months ago

sssssSleep commented 3 months ago

前置确认

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

操作系统类型?

Linux

运行的python版本是?

python 3.8

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

Master (branch)

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

按照完依赖后,复制默认配置文件,修改如下值 "model": "moonshot-v1-8k", "open_ai_api_key": "my api", "open_ai_api_base": "https://api.moonshot.cn/v1", 其余不变

问题描述 😯

err_pic

报错如图

终端日志 📒

[ERROR][2024-06-07 01:43:32][moonshot_bot.py:137] - can only concatenate str (not "NoneType") to str Traceback (most recent call last): File "/home/lhq/chatgpt-on-wechat/bot/moonshot/moonshot_bot.py", line 93, in reply_text "Authorization": "Bearer " + self.api_key TypeError: can only concatenate str (not "NoneType") to str [ERROR][2024-06-07 01:43:32][moonshot_bot.py:137] - can only concatenate str (not "NoneType") to str Traceback (most recent call last): File "/home/lhq/chatgpt-on-wechat/bot/moonshot/moonshot_bot.py", line 93, in reply_text "Authorization": "Bearer " + self.api_key TypeError: can only concatenate str (not "NoneType") to str

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/lhq/chatgpt-on-wechat/bot/moonshot/moonshot_bot.py", line 93, in reply_text "Authorization": "Bearer " + self.api_key TypeError: can only concatenate str (not "NoneType") to str [ERROR][2024-06-07 01:43:32][moonshot_bot.py:137] - can only concatenate str (not "NoneType") to str Traceback (most recent call last): File "/home/lhq/chatgpt-on-wechat/bot/moonshot/moonshot_bot.py", line 93, in reply_text "Authorization": "Bearer " + self.api_key TypeError: can only concatenate str (not "NoneType") to str

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/lhq/chatgpt-on-wechat/bot/moonshot/moonshot_bot.py", line 93, in reply_text "Authorization": "Bearer " + self.api_key TypeError: can only concatenate str (not "NoneType") to str

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/lhq/chatgpt-on-wechat/bot/moonshot/moonshot_bot.py", line 93, in reply_text "Authorization": "Bearer " + self.api_key

nku-shengzheliu commented 3 months ago

我也遇到了,把config.json里的模型api key从open_ai_api_key改成moonshot_api_key解决这个问题了

sssssSleep commented 3 months ago

我也遇到了,把config.json里的模型api key从open_ai_api_key改成moonshot_api_key解决这个问题了

感谢您的帮助,我已成功运行,谢谢!

liuhedev commented 1 month ago

我也遇到了,把config.json里的模型api key从open_ai_api_key改成moonshot_api_key解决这个问题了

是要删除 openai的配置才行吗?我的默认就走 openapi