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.27k stars 7.96k forks source link

调用fastgpt接口返回报错 #2111

Closed simon0207 closed 3 months ago

simon0207 commented 3 months ago

前置确认

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

操作系统类型?

Linux

运行的python版本是?

python 3.8

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

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

微信端输入bot获取当前时间返回

问题描述 😯

[WARNING][2024-06-26 11:53:55][session_manager.py:72] - Exception when counting tokens precisely for prompt: expected string or buffer [ERROR][2024-06-26 11:54:00][chat_channel.py:302] - Worker return exception: can only concatenate str (not "list") to str Traceback (most recent call last): File "/root/anaconda3/envs/chat/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 175, in _handle reply = self._decorate_reply(context, reply) File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 260, in _decorate_reply reply_text = conf().get("single_chat_reply_prefix", "") + reply_text + conf().get("single_chat_reply_suffix", "")

终端日志 📒

<此处粘贴终端日志>
6vision commented 3 months ago

image 参数格式配置有问题,不要改变参数的类型

wmqKevin commented 2 months ago

我也遇到了这个问题,我发现当fastgpt配置使用“工具调用”后,返回过来的reply.content是一个数组 image 这就导致了下面字符串拼接出错的问题

mess-in-a-dress commented 1 month ago

我也遇到了这个问题,我发现当fastgpt配置使用“工具调用”后,返回过来的reply.content是一个数组 image 这就导致了下面字符串拼接出错的问题

怎么解决呢

Linnnkkk commented 1 month ago

解决了吗?