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
28.35k stars 7.53k forks source link

企业微信部署报错,config.json not found #1262

Open theores opened 1 year ago

theores commented 1 year ago

前置确认

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

操作系统类型?

CentOS7

运行的python版本是?

python 3.7

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

Latest Release

运行的channel类型是?

wechatcom_app

复现步骤 🕹

使用的该项目所提供的docker镜像部署的,docker compose为如下配置:

version: '3.0'
services:
  chatgpt-on-wechat:
    image:  ghcr.io/zhayujie/chatgpt-on-wechat:latest
    container_name: sample-chatgpt-on-wechat
    volumes:
      - /home/docker-temp/config/wechatcombot.json:/app/config.json # 企业微信

问题描述 😯

启动后报错,config.json not found。企业微信后台API可以请求成功,但发送微信消息并不会触发回复,日志里显示

http://0.0.0.0:9898/
[INFO][2023-06-19 08:50:13][wechatcomapp_channel.py:133] - [wechatcom] receive params: 
172.29.0.1:53174 - - [19/Jun/2023 08:50:13] "HTTP/1.1 GET /wxcomapp" - 200 OK
[INFO][2023-06-19 08:50:27][wechatcomapp_channel.py:147] - [wechatcom] receive params: 
172.29.0.1:53230 - - [19/Jun/2023 08:50:27] "HTTP/1.1 POST /wxcomapp" - 200 OK

没有任何回复。

终端日志 📒

以下为容器启动日志,

[INFO][2023-06-19 08:42:00][config.py:199] - [INIT] load config: {'open_ai_api_key': 'sk-EQM6TtrJM861uARw1gDpT3BlbkFJxbpEAAA7XRT07gDLqpPtAHu', 'model': 'gpt-3.5-turbo', 'proxy': 'https://api.openai-proxy.com', 'single_chat_prefix': [], 'single_chat_reply_prefix': '', 'group_chat_prefix': ['@bot'], 'group_name_white_list': ['ChatGPT测试群', 'ChatGPT测试群2'], 'group_chat_in_one_session': ['ChatGPT测试群'], 'image_create_prefix': ['画', '看', '找'], 'conversation_max_tokens': 1000, 'speech_recognition': True, 'group_speech_recognition': False, 'use_azure_chatgpt': False, 'character_desc': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。', 'channel_type': 'wechatcom_app', 'wechatcom_corp_id': 'ww9ddb8e1ab1ee5d50', 'wechatcomapp_token': '19952518liuG', 'wechatcomapp_port': 9898, 'wechatcomapp_secret': '_QnZ3DqDdgPGH0GWutRErz3HCxq-jVlHRDxrfEDbhsM', 'wechatcomapp_agent_id': '1000002', 'wechatcomapp_aes_key': '8BMRF6pO8R3dpmDa2FAiq8DKCUAE61wUZeoI5voWYjY'}
[INFO][2023-06-19 08:42:00][config.py:149] - [Config] User datas file not found, ignore.
ww9ddb8e1ab1ee5d50 _QnZ3DqDdgPGH0GWutRErz3HCxq-jVlHRDxrfEDbhsM 1000002 19952518liuG 8BMRF6pO8R3dpmDa2FAiq8DKCUAE61wUZeoI5voWYjY
[INFO][2023-06-19 08:42:01][wechatcomapp_channel.py:39] - [wechatcom] init: corp_id: ww9ddb8e1ab1ee5d50, secret: _QnZ3DqDdgPGH0GWutRErz3HCxq-jVlHRDxrfEDbhsM, agent_id: 1000002, token: 19952518liuG, aes_key: 8BMRF6pO8R3dpmDa2FAiq8DKCUAE61wUZeoI5voWYjY
[INFO][2023-06-19 08:42:01][plugin_manager.py:50] - Loading plugins config...
[INFO][2023-06-19 08:42:01][plugin_manager.py:66] - Scaning plugins ...
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin BDunit_v0.1 registered, path=./plugins/bdunit
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Hello_v0.1 registered, path=./plugins/hello
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Keyword_v0.1 registered, path=./plugins/keyword
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Finish_v1.0 registered, path=./plugins/finish
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Godcmd_v1.0 registered, path=./plugins/godcmd
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Role_v1.0 registered, path=./plugins/role
chatgpt-tool-hub version: 0.4.4
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin tool_v0.4 registered, path=./plugins/tool
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Banwords_v1.0 registered, path=./plugins/banwords
[INFO][2023-06-19 08:42:01][plugin_manager.py:41] - Plugin Dungeon_v1.0 registered, path=./plugins/dungeon
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin GODCMD not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin KEYWORD not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin BANWORDS not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin TOOL not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin ROLE not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin DUNGEON not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin BDUNIT not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin HELLO not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][plugin_manager.py:101] - Plugin FINISH not found in pconfig, adding to pconfig...
[INFO][2023-06-19 08:42:01][godcmd.py:193] - [Godcmd] 因未设置口令,本次的临时口令为9650。
[INFO][2023-06-19 08:42:01][godcmd.py:208] - [Godcmd] inited
[INFO][2023-06-19 08:42:01][keyword.py:40] - [keyword] {}
[INFO][2023-06-19 08:42:01][keyword.py:42] - [keyword] inited.
[WARNING][2023-06-19 08:42:01][banwords.py:53] - [Banwords] init failed, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/banwords .
[ERROR][2023-06-19 08:42:01][plugin_manager.py:126] - Failed to init BANWORDS, diabled. [Errno 2] No such file or directory: '/app/plugins/banwords/banwords.txt'
Traceback (most recent call last):
  File "/app/plugins/plugin_manager.py", line 124, in activate_plugins
    instance = plugincls()
  File "/app/plugins/banwords/banwords.py", line 54, in __init__
    raise e
  File "/app/plugins/banwords/banwords.py", line 40, in __init__
    with open(banwords_path, "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/app/plugins/banwords/banwords.txt'
[INFO][2023-06-19 08:42:01][__init__.py:29] - [visual_dl] init failed, error_info: ModuleNotFoundError("No module named 'torch'")
[INFO][2023-06-19 08:42:01][__init__.py:29] - [visual_dl] init failed, error_info: ModuleNotFoundError("No module named 'torch'")
[INFO][2023-06-19 08:42:01][chatgpt.py:181] - success use proxy: https://api.openai-proxy.com
[INFO][2023-06-19 08:42:01][victorinox.py:86] - use_tools=['terminal', 'meteo-weather', 'url-get', 'python'], params: {'debug': False, 'openai_api_key': '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', 'open_ai_api_base': 'https://api.openai.com/v1', 'proxy': 'https://api.openai-proxy.com', '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': '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', 'llm_api_base_url': 'https://api.openai.com/v1'}
[INFO][2023-06-19 08:42:01][tool.py:32] - [tool] inited
[INFO][2023-06-19 08:42:01][role.py:69] - [Role] inited
[INFO][2023-06-19 08:42:01][dungeon.py:56] - [Dungeon] inited
[WARNING][2023-06-19 08:42:01][bdunit.py:47] - [BDunit] init failed, ignore 
[ERROR][2023-06-19 08:42:01][plugin_manager.py:126] - Failed to init BDUNIT, diabled. config.json not found
Traceback (most recent call last):
  File "/app/plugins/plugin_manager.py", line 124, in activate_plugins
    instance = plugincls()
  File "/app/plugins/bdunit/bdunit.py", line 48, in __init__
    raise e
  File "/app/plugins/bdunit/bdunit.py", line 36, in __init__
    raise Exception("config.json not found")
Exception: config.json not found
[INFO][2023-06-19 08:42:01][hello.py:23] - [Hello] inited
[INFO][2023-06-19 08:42:01][finish.py:23] - [Finish] inited
chenbe1990 commented 1 year ago

我也是这个问题,我解决了,就是config.json里面的参数写错

thefreelight commented 1 year ago

哪里写错呢

Jas0nxlee commented 1 year ago

我也是这个问题,我解决了,就是config.json里面的参数写错

同问,哪里写错了呢

maya1900 commented 7 months ago

我也是这个问题,我解决了,就是config.json里面的参数写错

同问,哪里写错了呢

[ERROR][2023-06-19 08:42:01][plugin_manager.py:126] - Failed to init BDUNIT, diabled. config.json not found

需要配置一个bdunit, 看bdunit的readme,然后加到config.json里去:

...
bdunit: {
...
},
...