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
29.48k stars 7.8k forks source link

终端日志显示有收到消息,但是没有回复 #1796

Closed 2022Cyberpunk closed 1 month ago

2022Cyberpunk commented 5 months ago

前置确认

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

操作系统类型?

Windows

运行的python版本是?

python 3.9

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

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

登录微信,终端日志显示“Start auto replying.”,在微信中触发回复,日志显示: [INFO][2024-03-07 19:20:12][wechat_channel.py:55] - Wechat message 2569477669018011468 already received, ignore [INFO][2024-03-07 19:20:12][wechat_channel.py:55] - Wechat message 5985692862323257639 already received, ignore [INFO][2024-03-07 19:20:12][wechat_channel.py:55] - Wechat message 6036317815488064063 already received, ignore

问题描述 😯

日志显示能接受消息,但是没有回复。虽然代理有点延迟,时不时会断开。

终端日志 📒

[INFO][2024-03-07 19:30:24][wechat_channel.py:55] - Wechat message 4422137691476941872 already received, ignore [INFO][2024-03-07 19:30:24][wechat_channel.py:55] - Wechat message 4422137691476941872 already received, ignore [INFO][2024-03-07 19:31:07][wechat_channel.py:55] - Wechat message 5309777521437530587 already received, ignore [INFO][2024-03-07 19:31:08][wechat_channel.py:55] - Wechat message 5309777521437530587 already received, ignore Traceback (most recent call last): File "D:\Software installation\Python\lib\site-packages\urllib3\connectionpool.py", line 667, in urlopen self._prepare_proxy(conn) File "D:\Software installation\Python\lib\site-packages\urllib3\connectionpool.py", line 932, in _prepare_proxy conn.connect() File "D:\Software installation\Python\lib\site-packages\urllib3\connection.py", line 362, in connect self.sock = ssl_wrapsocket( File "D:\Software installation\Python\lib\site-packages\urllib3\util\ssl.py", line 386, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "D:\Software installation\Python\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "D:\Software installation\Python\lib\ssl.py", line 1040, in _create self.do_handshake() File "D:\Software installation\Python\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

2022Cyberpunk commented 5 months ago

补充下详细终端日志: [INFO][2024-03-08 08:31:49][config.py:254] - [INIT] load config: {'channel_type': 'wx', 'model': 'gpt-3.5-turbo', 'open_ai_api_key': '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', 'text_to_image': 'dall-e-2', 'voice_to_text': 'openai', 'text_to_voice': 'openai', 'proxy': 'http://127.0.0.1:7890', 'hot_reload': True, 'single_chat_prefix': ['dog', 'bot'], 'single_chat_reply_prefix': '[reply] ', 'group_chat_prefix': ['dog'], 'group_name_white_list': ['有问题就有答案', 'ChatGPT测试群2'], 'image_create_prefix': ['画'], 'speech_recognition': True, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 2500, 'expires_in_seconds': 3600, 'character_desc': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。', 'temperature': 0.7, 'subscribe_msg': '感谢您的关注!\n这里是AI智能助手,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。', 'use_linkai': False, 'linkai_api_key': '', 'linkai_app_code': ''} [INFO][2024-03-08 08:31:49][config.py:204] - [Config] User datas file not found, ignore. [WARNING][2024-03-08 08:31:49][audio_convert.py:9] - import pysilk failed, wechaty voice message will not be supported. D:\Software installation\Python\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) [INFO][2024-03-08 08:31:49][plugin_manager.py:50] - Loading plugins config... [INFO][2024-03-08 08:31:49][plugin_manager.py:88] - Scaning plugins ... [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Banwords_v1.0 registered, path=./plugins\banwords [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin BDunit_v0.1 registered, path=./plugins\bdunit [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Dungeon_v1.0 registered, path=./plugins\dungeon [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Finish_v1.0 registered, path=./plugins\finish [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Godcmd_v1.0 registered, path=./plugins\godcmd [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Hello_v0.1 registered, path=./plugins\hello [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Keyword_v0.1 registered, path=./plugins\keyword [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin linkai_v0.1.0 registered, path=./plugins\linkai [INFO][2024-03-08 08:31:49][plugin_manager.py:41] - Plugin Role_v1.0 registered, path=./plugins\role chatgpt-tool-hub version: 0.5.0 [INFO][2024-03-08 08:31:50][plugin_manager.py:41] - Plugin tool_v0.5 registered, path=./plugins\tool [INFO][2024-03-08 08:31:50][godcmd.py:194] - [Godcmd] 因未设置口令,本次的临时口令为9325。 [INFO][2024-03-08 08:31:50][godcmd.py:210] - [Godcmd] inited [INFO][2024-03-08 08:31:50][keyword.py:40] - [keyword] {} [INFO][2024-03-08 08:31:50][keyword.py:42] - [keyword] inited. [INFO][2024-03-08 08:31:50][linkai.py:33] - [LinkAI] inited, config={'group_app_map': {'测试群名1': 'default', '测试群名2': 'Kv2fXJcH'}, 'midjourney': {'enabled': False, 'auto_translate': True, 'img_proxy': True, 'max_tasks': 3, 'max_tasks_per_user': 1, 'use_image_create_prefix': True}, 'summary': {'enabled': False, 'group_enabled': True, 'max_file_size': 5000, 'type': ['FILE', 'SHARING']}} [INFO][2024-03-08 08:31:50][init.py:39] - [browser] initialization failed, error_info: ImportError('selenium is not installed. Please install it with pip install selenium') [INFO][2024-03-08 08:31:50][init.py:39] - [bing-search] initialization failed, error_info: 1 validation error for BingSearchAPIWrapper Value error, Did not find bing_subscription_key, please add an environment variable BING_SUBSCRIPTION_KEY which contains it, or pass bing_subscription_key as a named parameter. [type=value_error, input_value={'log': True, 'debug': Fa...olfram_alpha_appid': ''}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [INFO][2024-03-08 08:32:01][init.py:39] - [email] initialization failed, error_info: ValueError('Did not find email_sender, please add an environment variable EMAIL_SENDER which contains it, or pass email_sender as a named parameter.') [INFO][2024-03-08 08:32:01][init.py:39] - [google-search] initialization failed, error_info: 1 validation error for GoogleSearchAPIWrapper Value error, Did not find google_api_key, please add an environment variable GOOGLE_API_KEY which contains it, or pass google_api_key as a named parameter. [type=value_error, input_value={'log': True, 'debug': Fa...olfram_alpha_appid': ''}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [INFO][2024-03-08 08:32:01][init.py:39] - [morning-news] initialization failed, error_info: ValueError('Did not find morning_news_api_key, please add an environment variable MORNING_NEWS_API_KEY which contains it, or pass morning_news_api_key as a named parameter.') [INFO][2024-03-08 08:32:01][init.py:39] - [news-api] initialization failed, error_info: ValueError('Did not find news_api_key, please add an environment variable NEWS_API_KEY which contains it, or pass news_api_key as a named parameter.') [INFO][2024-03-08 08:32:01][init.py:39] - [searxng-search] initialization failed, error_info: 1 validation error for SearxSearchWrapper Value error, Did not find searxng_search_host, please add an environment variable SEARXNG_SEARCH_HOST which contains it, or pass searxng_search_host as a named parameter. [type=value_error, input_value={'log': True, 'debug': Fa...'zh', 'format': 'json'}}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [INFO][2024-03-08 08:32:01][init.py:39] - [sms] initialization failed, error_info: ValueError('Did not find sms_username, please add an environment variable SMS_USERNAME which contains it, or pass sms_username as a named parameter.') [INFO][2024-03-08 08:32:01][init.py:39] - [stt] initialization failed, error_info: ValueError('Did not find stt_api_key, please add an environment variable STT_API_KEY which contains it, or pass stt_api_key as a named parameter.') [INFO][2024-03-08 08:32:01][init.py:39] - [tts] initialization failed, error_info: ValueError('Did not find tts_api_key, please add an environment variable TTS_API_KEY which contains it, or pass tts_api_key as a named parameter.') [INFO][2024-03-08 08:32:01][init.py:39] - [visual] initialization failed, error_info: 1 validation error for DashScopeWrapper Value error, Did not find caption_api_key, please add an environment variable CAPTION_API_KEY which contains it, or pass caption_api_key as a named parameter. [type=value_error, input_value={'log': True, 'debug': Fa...ultiModalConversation'>}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [INFO][2024-03-08 08:32:02][wrapper.py:82] - [wechat] login success, user_id: @bf43b7262a6a02dbdf3a6bcd564cb426cee45b19dfd6b4b6752837b5fdc804cf, nickname: 冰原狼 [INFO][2024-03-08 08:32:02][init.py:39] - [wolfram-alpha] initialization failed, error_info: 1 validation error for WolframAlphaAPIWrapper Value error, Did not find wolfram_alpha_appid, please add an environment variable WOLFRAM_ALPHA_APPID which contains it, or pass wolfram_alpha_appid as a named parameter. [type=value_error, input_value={'log': True, 'debug': Fa...olfram_alpha_appid': ''}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/value_error [INFO][2024-03-08 08:32:03][wrapper.py:82] - [wechat] login success, user_id: @bf43b7262a6a02dbdf3a6bcd564cb426cee45b19dfd6b4b6752837b5fdc804cf, nickname: 冰原狼 [INFO][2024-03-08 08:32:03][victorinox.py:83] - use_tools=['meteo', 'python', 'terminal', 'url-get'], params: {'log': True, 'debug': False, 'no_default': False, 'think_depth': 2, 'proxy': 'http://127.0.0.1:7890', 'request_timeout': 120, 'temperature': 0, 'llm_api_key': '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', 'llm_api_base_url': 'https://api.openai.com/v1', 'deployment_id': '', 'model_name': 'gpt-3.5-turbo', 'arxiv_simple': True, 'arxiv_top_k_results': 2, 'arxiv_sort_by': 'relevance', 'arxiv_sort_order': 'descending', 'arxiv_output_type': 'text', 'bing_subscription_key': '', 'bing_search_url': 'https://api.bing.microsoft.com/v7.0/search', 'bing_search_top_k_results': 2, 'bing_search_simple': True, 'bing_search_output_type': 'text', 'email_nickname_mapping': '{}', 'email_smtp_host': '', 'email_smtp_port': '', 'email_sender': '', 'email_authorization_code': '', 'google_api_key': '', 'google_cse_id': '', 'google_simple': True, 'google_output_type': 'text', 'finance_news_filter': False, 'finance_news_filter_list': [], 'finance_news_simple': True, 'finance_news_repeat_news': False, 'morning_news_api_key': '', 'morning_news_simple': True, 'morning_news_output_type': 'text', 'news_api_key': '', 'searxng_search_host': '', 'searxng_search_top_k_results': 2, 'searxng_search_output_type': 'text', 'sms_nickname_mapping': '{}', 'sms_username': '', 'sms_apikey': '', 'stt_api_key': '', 'stt_api_region': '', 'stt_recognition_language': 'zh-CN', 'tts_api_key': '', 'tts_api_region': '', 'tts_auto_detect': True, 'tts_speech_id': 'zh-CN-XiaozhenNeural', 'summary_max_segment_length': 2500, 'terminal_nsfc_filter': True, 'terminal_return_err_output': True, 'terminal_timeout': 20, 'caption_api_key': '', 'browser_use_summary': True, 'url_get_use_summary': True, 'wechat_hot_reload': True, 'wechat_cpt_path': 'E:\GPT-wechat\chatgpt-on-wechat-1.5.7.1\itchat.pkl', 'wechat_send_group': False, 'wechat_nickname_mapping': '{}', 'wikipedia_top_k_results': 2, 'wolfram_alpha_appid': ''} [INFO][2024-03-08 08:32:03][tool.py:28] - [tool] inited [INFO][2024-03-08 08:32:03][role.py:69] - [Role] inited [INFO][2024-03-08 08:32:03][dungeon.py:56] - [Dungeon] inited [INFO][2024-03-08 08:32:03][hello.py:24] - [Hello] inited [INFO][2024-03-08 08:32:03][finish.py:23] - [Finish] inited [INFO][2024-03-08 08:32:06][wechat_channel.py:131] - Wechat login success, user_id: @bf43b7262a6a02dbdf3a6bcd564cb426cee45b19dfd6b4b6752837b5fdc804cf, nickname: 冰原狼 Start auto replying. [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 2180189959442630526 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 7458414101260805715 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 8174517837553504287 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 2469544576867055683 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 4022043726279946041 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 4956508556995501121 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 7235869767257150120 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 2180189959442630526 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 7458414101260805715 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 8174517837553504287 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 2469544576867055683 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 4022043726279946041 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 4956508556995501121 already received, ignore [INFO][2024-03-08 08:32:06][wechat_channel.py:55] - Wechat message 7235869767257150120 already received, ignore

asukaaaaa11 commented 5 months ago

我也是这样的你解决了嘛

6vision commented 5 months ago

参考 #1820