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
31.04k stars 8.09k forks source link

微信公众号回答结果中总是包含 [ERROR] #1248

Open lfchen2017 opened 1 year ago

lfchen2017 commented 1 year ago

前置确认

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

操作系统类型?

Docker

运行的python版本是?

python 3.8

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

Latest Release

运行的channel类型是?

wechatmp(公众号, 订阅号)

复现步骤 🕹

接入公众号后进行问答即会出现

问题描述 😯

image 返回结果中一直会携带 [ERROR] 前缀

终端日志 📒

[INFO][2023-06-14 09:10:48][passive_reply.py:151] - [wechatmp] Request 2 do send to xxxx: 你叫什么
Jun 14 05:10:48 PM  [ERROR]
Jun 14 05:10:48 PM  我是ChatGPT,一个由OpenAI训练的大型语言模型。我可以回答各种问题、提供信息、进行闲聊、解决问题,甚至帮助你进行创作和写作。无论你需要什么帮助或者有什么问题,我都会尽力为你提供支持和答案。请告诉我你需要什么帮助,我会尽力满足你的需求。
lanvent commented 1 year ago

除了apikey以外的配置,和完整日志贴一下

lfchen2017 commented 1 year ago

配置文件

channel_type=wechatmp conversation_max_tokens=1000 expires_in_seconds=3600 group_chat_in_one_session=["ChatGPT测试群"] group_chat_prefix=["@bot"] group_name_white_list=["ChatGPT测试群", "ChatGPT测试群2"] group_speech_recognition=False image_create_prefix=["画", "看", "找"] model=gpt-3.5-turbo plugin_trigger_prefix=& single_chat_prefix=[""] single_chat_reply_prefix=[bot] speech_recognition=True voice_reply_voice=False wechatmp_aes_key=xxx wechatmp_app_id=xxx wechatmp_app_secret=xxx wechatmp_port=443 wechatmp_token=xxxx

启动日志

Jun 14 05:24:17 PM Starting service... Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: open_ai_api_base=https://api.openai.com/v1 Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: wechatmp_app_secret=xxx Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: single_chat_prefix=[""] Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: speech_recognition=True Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: image_create_prefix=["画", "看", "找"] Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: wechatmp_token=xxxx Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: voice_reply_voice=False Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: open_ai_api_key=xxx Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: expires_in_seconds=3600 Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: conversation_max_tokens=1000 Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: model=gpt-3.5-turbo Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: wechatmp_aes_key=xxx Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: channel_type=wechatmp Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: use_azure_chatgpt=false Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: wechatmp_app_id=xxx Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:184] - [INIT] override config by environ args: wechatmp_port=443 Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:199] - [INIT] load config: {'open_ai_api_key': 'xxxx', 'model': 'gpt-3.5-turbo', 'proxy': '', 'single_chat_prefix': [''], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': ['ChatGPT测试群', 'ChatGPT测试群2'], 'group_chat_in_one_session': ['ChatGPT测试群'], 'image_create_prefix': ['画', '看', '找'], 'speech_recognition': True, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 1000, 'expires_in_seconds': 3600, 'character_desc': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。', 'subscribe_msg': '感谢您的关注!\n这里是ChatGPT,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。', 'use_linkai': False, 'linkai_api_key': '', 'linkai_app_code': '', 'open_ai_api_base': 'https://api.openai.com/v1', 'wechatmp_app_secret': 'xxx', 'wechatmp_token': 'xxx', 'wechatmp_aes_key': 'xxx', 'channel_type': 'wechatmp', 'use_azure_chatgpt': False, 'wechatmp_app_id': 'xxx', 'wechatmp_port': 443} Jun 14 05:24:24 PM [INFO][2023-06-14 09:24:24][config.py:149] - [Config] User datas file not found, ignore. Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:50] - Loading plugins config... Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:66] - Scaning plugins ... Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin Role_v1.0 registered, path=./plugins/role Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin Finish_v1.0 registered, path=./plugins/finish Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin Dungeon_v1.0 registered, path=./plugins/dungeon Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin Keyword_v0.1 registered, path=./plugins/keyword Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin Hello_v0.1 registered, path=./plugins/hello Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin BDunit_v0.1 registered, path=./plugins/bdunit Jun 14 05:24:26 PM [INFO][2023-06-14 09:24:26][plugin_manager.py:41] - Plugin Banwords_v1.0 registered, path=./plugins/banwords Jun 14 05:24:31 PM chatgpt-tool-hub version: 0.4.4 Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:41] - Plugin tool_v0.4 registered, path=./plugins/tool Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:41] - Plugin Godcmd_v1.0 registered, path=./plugins/godcmd Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin GODCMD not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin KEYWORD not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin BANWORDS not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin TOOL not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin ROLE not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin DUNGEON not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin BDUNIT not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin HELLO not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][plugin_manager.py:101] - Plugin FINISH not found in pconfig, adding to pconfig... Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][godcmd.py:193] - [Godcmd] 因未设置口令,本次的临时口令为4369。 Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][godcmd.py:208] - [Godcmd] inited Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][keyword.py:40] - [keyword] {} Jun 14 05:24:31 PM [INFO][2023-06-14 09:24:31][keyword.py:42] - [keyword] inited. Jun 14 05:24:31 PM [WARNING][2023-06-14 09:24:31][banwords.py:53] - [Banwords] init failed, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/banwords . Jun 14 05:24:31 PM [ERROR][2023-06-14 09:24:31][plugin_manager.py:126] - Failed to init BANWORDS, diabled. [Errno 2] No such file or directory: '/app/plugins/banwords/banwords.txt' Jun 14 05:24:31 PM Traceback (most recent call last): Jun 14 05:24:31 PM File "/app/plugins/plugin_manager.py", line 124, in activate_plugins Jun 14 05:24:31 PM instance = plugincls() Jun 14 05:24:31 PM File "/app/plugins/banwords/banwords.py", line 54, in init Jun 14 05:24:31 PM raise e Jun 14 05:24:31 PM File "/app/plugins/banwords/banwords.py", line 40, in init Jun 14 05:24:31 PM with open(banwords_path, "r", encoding="utf-8") as f: Jun 14 05:24:31 PM FileNotFoundError: [Errno 2] No such file or directory: '/app/plugins/banwords/banwords.txt' Jun 14 05:24:32 PM [INFO][2023-06-14 09:24:32][init.py:29] - [visual_dl] init failed, error_info: ModuleNotFoundError("No module named 'torch'") Jun 14 05:24:32 PM [INFO][2023-06-14 09:24:32][init.py:29] - [visual_dl] init failed, error_info: ModuleNotFoundError("No module named 'torch'") Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][chatgpt.py:183] - proxy no find, directly request to chatgpt instead Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][chatgpt.py:188] - success use customized api base url: https://api.openai.com/v1 Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][chatgpt.py:183] - proxy no find, directly request to chatgpt instead Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][victorinox.py:86] - use_tools=['python', 'url-get', 'meteo-weather', 'terminal'], params: {'debug': False, 'openai_api_key': 'xxxx', 'open_ai_api_base': 'https://api.openai.com/v1', 'proxy': '', 'request_timeout': 120, 'model_name': 'gpt-3.5-turbo', 'no_default': False, 'top_k_results': 3, 'news_api_key': '', 'bing_subscription_key': '', 'google_api_key': '', 'google_cse_id': '', 'searx_search_host': '', 'wolfram_alpha_appid': '', 'morning_news_api_key': '', 'cuda_device': 'cpu', 'think_depth': 3, 'arxiv_summary': True, 'morning_news_use_llm': False, 'llm_api_key': 'xxxx', 'llm_api_base_url': 'https://api.openai.com/v1'} Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][tool.py:32] - [tool] inited Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][role.py:69] - [Role] inited Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][dungeon.py:56] - [Dungeon] inited Jun 14 05:24:33 PM [WARNING][2023-06-14 09:24:33][bdunit.py:47] - [BDunit] init failed, ignore Jun 14 05:24:33 PM [ERROR][2023-06-14 09:24:33][plugin_manager.py:126] - Failed to init BDUNIT, diabled. config.json not found Jun 14 05:24:33 PM Traceback (most recent call last): Jun 14 05:24:33 PM File "/app/plugins/plugin_manager.py", line 124, in activate_plugins Jun 14 05:24:33 PM instance = plugincls() Jun 14 05:24:33 PM File "/app/plugins/bdunit/bdunit.py", line 48, in init Jun 14 05:24:33 PM raise e Jun 14 05:24:33 PM File "/app/plugins/bdunit/bdunit.py", line 36, in init Jun 14 05:24:33 PM raise Exception("config.json not found") Jun 14 05:24:33 PM Exception: config.json not found Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][hello.py:23] - [Hello] inited Jun 14 05:24:33 PM [INFO][2023-06-14 09:24:33][finish.py:23] - [Finish] inited Jun 14 05:24:38 PM Your service is live 🎉

运行日志

Jun 14 05:43:08 PM [INFO][2023-06-14 09:43:08][passive_reply.py:151] - [wechatmp] Request 2 do send to xxx: 你叫什么 Jun 14 05:43:08 PM [ERROR] Jun 14 05:43:08 PM 我是ChatGPT,一个由OpenAI训练的大型语言模型。我没有固定的名字,你可以简单地称呼我为ChatGPT。我旨在回答和解决各种问题,并且可以使用多种语言进行交流。有什么我可以帮助你的吗? Jun 14 05:43:08 PM 127.0.0.1:56732 - - [14/Jun/2023 09:43:08] "HTTP/1.1 POST /wx" - 200 OK Jun 14 05:43:09 PM 127.0.0.1:60664 - - [14/Jun/2023 09:43:09] "HTTP/1.1 POST /wx" - 200 OK

lanvent commented 1 year ago

配置应该没有问题,可否将debug=True添加到配置中, 贴出一轮完整问答过程的运行日志

OuDale commented 1 year ago

遇到同样的问题:debug

[DEBUG][2023-06-21 16:54:30][chat_channel.py:312] - [WX] consume context: Context(type=TEXT, content=今天天气怎么样, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x10607a7d0>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@0f271f7bc36f0f1b2198b2547e4e9cac', 'receiver': '@0f271f7bc36f0f1b2198b2547e4e9cac'}) [DEBUG][2023-06-21 16:54:30][chat_channel.py:144] - [WX] ready to handle context: Context(type=TEXT, content=今天天气怎么样, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x10607a7d0>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@0f271f7bc36f0f1b2198b2547e4e9cac', 'receiver': '@0f271f7bc36f0f1b2198b2547e4e9cac'}) [DEBUG][2023-06-21 16:54:30][plugin_manager.py:163] - Plugin GODCMD triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-21 16:54:30][godcmd.py:218] - [Godcmd] on_handle_context. content: 今天天气怎么样 [DEBUG][2023-06-21 16:54:30][plugin_manager.py:163] - Plugin KEYWORD triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-21 16:54:30][keyword.py:52] - [keyword] on_handle_context. content: 今天天气怎么样 [DEBUG][2023-06-21 16:54:30][plugin_manager.py:163] - Plugin ROLE triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-21 16:54:30][plugin_manager.py:163] - Plugin DUNGEON triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-21 16:54:30][dungeon.py:73] - [Dungeon] on_handle_context. content: ['今天天气怎么样'] [DEBUG][2023-06-21 16:54:30][plugin_manager.py:163] - Plugin HELLO triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-21 16:54:30][hello.py:48] - [Hello] on_handle_context. content: 今天天气怎么样 [DEBUG][2023-06-21 16:54:30][plugin_manager.py:163] - Plugin FINISH triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-21 16:54:30][finish.py:30] - [Finish] on_handle_context. content: 今天天气怎么样 [DEBUG][2023-06-21 16:54:30][chat_channel.py:164] - [WX] ready to handle context: type=TEXT, content=今天天气怎么样 [INFO][2023-06-21 16:54:30][chat_gpt_bot.py:49] - [CHATGPT] query=今天天气怎么样 [DEBUG][2023-06-21 16:54:30][session_manager.py:70] - prompt tokens used=92 [DEBUG][2023-06-21 16:54:30][chat_gpt_bot.py:66] - [CHATGPT] session query=[{'role': 'system', 'content': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。'}, {'role': 'user', 'content': '你可以帮忙写代码吗'}, {'role': 'user', 'content': '今天天气怎么样'}] [DEBUG][2023-06-21 16:54:38][chat_gpt_bot.py:79] - [CHATGPT] new_query=[{'role': 'system', 'content': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。'}, {'role': 'user', 'content': '你可以帮忙写代码吗'}, {'role': 'user', 'content': '今天天气怎么样'}], session_id=@0f271f7bc36f0f1b2198b2547e4e9cac, reply_cont=很抱歉,作为一款语言模型,我无法直接获取实时天气信息。我在2021年9月之前的知识库中被训练,无法提供关于当前日期的天气预报。建议你使用天气预报网站、手机应用程序或搜索引擎来获取最新的天气信息。, completion_tokens=0 [DEBUG][2023-06-21 16:54:38][chat_channel.py:148] - [WX] ready to decorate reply: Reply(type=ERROR, content=很抱歉,作为一款语言模型,我无法直接获取实时天气信息。我在2021年9月之前的知识库中被训练,无法提供关于当前日期的天气预报。建议你使用天气预报网站、手机应用程序或搜索引擎来获取最新的天气信息。)

lanvent commented 1 year ago

感谢日志,请问你使用的模型是gpt-3.5-turbo吗。 可否把这行取消注释后,再发一下相关日志呢 https://github.com/zhayujie/chatgpt-on-wechat/blob/957f2574a9b8da484fffcd1fe18d6faec831993f/bot/chatgpt/chat_gpt_bot.py#L124

wc4443329445 commented 1 year ago

你这是私聊还是群聊

OuDale commented 1 year ago

感谢日志,请问你使用的模型是gpt-3.5-turbo吗。 可否把这行取消注释后,再发一下相关日志呢

https://github.com/zhayujie/chatgpt-on-wechat/blob/957f2574a9b8da484fffcd1fe18d6faec831993f/bot/chatgpt/chat_gpt_bot.py#L124

模型是gpt-3.5-turbo, 日志如下: [DEBUG][2023-06-25 09:26:53][chat_channel.py:312] - [WX] consume context: Context(type=TEXT, content=你好, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x1049bdd20>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@7d1ba1527788d20f22951a765b23534f', 'receiver': '@7d1ba1527788d20f22951a765b23534f'}) [DEBUG][2023-06-25 09:26:53][chat_channel.py:144] - [WX] ready to handle context: Context(type=TEXT, content=你好, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x1049bdd20>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@7d1ba1527788d20f22951a765b23534f', 'receiver': '@7d1ba1527788d20f22951a765b23534f'}) [DEBUG][2023-06-25 09:26:53][plugin_manager.py:163] - Plugin GODCMD triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-25 09:26:53][godcmd.py:218] - [Godcmd] on_handle_context. content: 你好 [DEBUG][2023-06-25 09:26:53][plugin_manager.py:163] - Plugin KEYWORD triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-25 09:26:53][keyword.py:52] - [keyword] on_handle_context. content: 你好 [DEBUG][2023-06-25 09:26:53][plugin_manager.py:163] - Plugin ROLE triggered by event Event.ON_HANDLE_CONTEXT [INFO][2023-06-25 09:26:53][bridge.py:32] - create bot chatGPT for chat [DEBUG][2023-06-25 09:26:53][plugin_manager.py:163] - Plugin DUNGEON triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-25 09:26:53][dungeon.py:73] - [Dungeon] on_handle_context. content: ['你好'] [DEBUG][2023-06-25 09:26:53][plugin_manager.py:163] - Plugin HELLO triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-25 09:26:53][hello.py:48] - [Hello] on_handle_context. content: 你好 [DEBUG][2023-06-25 09:26:53][plugin_manager.py:163] - Plugin FINISH triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2023-06-25 09:26:53][finish.py:30] - [Finish] on_handle_context. content: 你好 [DEBUG][2023-06-25 09:26:53][chat_channel.py:164] - [WX] ready to handle context: type=TEXT, content=你好 [INFO][2023-06-25 09:26:53][chat_gpt_bot.py:49] - [CHATGPT] query=你好 [DEBUG][2023-06-25 09:26:56][session_manager.py:70] - prompt tokens used=70 [DEBUG][2023-06-25 09:26:56][chat_gpt_bot.py:66] - [CHATGPT] session query=[{'role': 'system', 'content': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。'}, {'role': 'user', 'content': '你好'}] [DEBUG][2023-06-25 09:26:59][chat_gpt_bot.py:124] - [CHATGPT] response={ "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "\u4f60\u597d\uff01\u5f88\u9ad8\u5174\u89c1\u5230\u4f60\u3002\u6211\u662fChatGPT\uff0c\u6211\u53ef\u4ee5\u56de\u7b54\u5404\u79cd\u95ee\u9898\uff0c\u5e2e\u52a9\u4f60\u89e3\u51b3\u7591\u60d1\u3002\u6709\u4ec0\u4e48\u6211\u53ef\u4ee5\u5e2e\u52a9\u4f60\u7684\u5417\uff1f", "role": "assistant" } } ], "created": 1687656418, "id": "chatcmpl-bTXkbWcgsndI0YnlMTZPwNY0dxgyR", "model": "gpt-3.5-turbo", "object": "chat.completion", "usage": { "completion_tokens": 0, "prompt_tokens": 0, "total_tokens": 0 } } [DEBUG][2023-06-25 09:26:59][chat_gpt_bot.py:79] - [CHATGPT] new_query=[{'role': 'system', 'content': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。'}, {'role': 'user', 'content': '你好'}], session_id=@7d1ba1527788d20f22951a765b23534f, reply_cont=你好!很高兴见到你。我是ChatGPT,我可以回答各种问题,帮助你解决疑惑。有什么我可以帮助你的吗?, completion_tokens=0 [DEBUG][2023-06-25 09:26:59][chat_channel.py:148] - [WX] ready to decorate reply: Reply(type=ERROR, content=你好!很高兴见到你。我是ChatGPT,我可以回答各种问题,帮助你解决疑惑。有什么我可以帮助你的吗?) [DEBUG][2023-06-25 09:26:59][chat_channel.py:251] - [WX] ready to send reply: Reply(type=ERROR, content=[ERROR] 你好!很高兴见到你。我是ChatGPT,我可以回答各种问题,帮助你解决疑惑。有什么我可以帮助你的吗?), context: Context(type=TEXT, content=你好, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x1049bdd20>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@7d1ba1527788d20f22951a765b23534f', 'receiver': '@7d1ba1527788d20f22951a765b23534f'}) [INFO][2023-06-25 09:26:59][wechat_channel.py:186] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR] 你好!很高兴见到你。我是ChatGPT,我可以回答各种问题,帮助你解决疑惑。有什么我可以帮助你的吗?), receiver=@7d1ba1527788d20f22951a765b23534f [DEBUG][2023-06-25 09:26:59][chat_channel.py:267] - Worker return success, session_id = @7d1ba1527788d20f22951a765b23534f

OuDale commented 1 year ago

你这是私聊还是群聊

私聊

y535744264h commented 1 year ago

确实 我也存在同样的问题

hanqiangfei commented 5 months ago

我也是遇到[chat_channel.py:284] - [WX] ready to send reply: Reply(type=ERROR, content=[ERROR] 问题

hanqiangfei commented 5 months ago

vim chatgpt-on-wechat/channel/chat_channel.py文件,在194行增加 reply.type=ReplyType(context.type.value)即可解决问题 if context.type == ContextType.TEXT or context.type == ContextType.IMAGE_CREATE: # 文字和图片消息 context["channel"] = e_context["channel"] reply = super().build_reply_content(context.content, context) reply.type=ReplyType(context.type.value)

soryer commented 3 weeks ago

vim chatgpt-on-wechat/channel/chat_channel.py文件,在194行增加 reply.type=ReplyType(context.type.value)即可解决问题 if context.type == ContextType.TEXT or context.type == ContextType.IMAGE_CREATE: # 文字和图片消息 context["channel"] = e_context["channel"] reply = super().build_reply_content(context.content, context) reply.type=ReplyType(context.type.value)

有效! Docker部署遇到[ERROR]问题,测试成功