goldfishh / chatgpt-tool-hub

An open-source chatgpt tool ecosystem where you can combine tools with chatgpt and use natural language to do anything.
MIT License
1.2k stars 160 forks source link

chatgpt-on-wechat中扩展tool工具无法生效 #56

Open JustForLp opened 1 year ago

JustForLp commented 1 year ago

前置确认

1. 网络能够访问openai接口

可以

2. git pull 拉取最新代码

已拉取

3. 执行pip install -r requirements.txt,检查依赖是否满足

满足

4. 在已有 issue 中未搜索到类似问题

不能

5. 注意,提issue前请确认用本项目test.py(参考README.md 快速开始配置)重试一次你的问题是否能复现

问题描述

chatgpt-on-wechat中tool/下增减config.json未生效

  1. 你的问题是否在test.py能复现?

  2. 你复现时的config.json,注意抹去你的api-key

    
    {
    "tools":[
        "news",
        "google-search",
        "morning-news"
    ],
    "kwargs":{
        "debug":false,
        "request_timeout":120,
        "no_default":false,
        "model_name":"gpt-3.5-turbo",
        "news_api_key":" ",
        "google_api_key":" ",
        "google_cse_id":" ",
        "morning_news_api_key":" "
    }
    }

4. debug模式终端打印的日志:

```text
[INFO][2023-05-26 04:24:09][config.py:180] - [INIT] override config by environ args: group_chat_in_one_session=["ALL_GROUP"]
[INFO][2023-05-26 04:24:09][config.py:180] - [INIT] override config by environ args: group_name_white_list=["ALL_GROUP"]
[INFO][2023-05-26 04:24:09][config.py:180] - [INIT] override config by environ args: open_ai_api_key= 
[INFO][2023-05-26 04:24:09][config.py:195] - [INIT] load config: {'open_ai_api_key': '', 'model': 'gpt-3.5-turbo', 'proxy': '', 'single_chat_prefix': ['bot', '@bot'], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': ['ALL_GROUP'], 'group_chat_in_one_session': ['ALL_GROUP'], 'image_create_prefix': ['画', '看', '找'], 'speech_recognition': False, '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 查看详细指令。'}
[INFO][2023-05-26 04:24:09][config.py:145] - [Config] User datas file not found, ignore.
█
[INFO][2023-05-26 04:24:11][plugin_manager.py:50] - Loading plugins config...
[INFO][2023-05-26 04:24:11][plugin_manager.py:66] - Scaning plugins ...
chatgpt-tool-hub version: 0.4.3
[INFO][2023-05-26 04:24:14][plugin_manager.py:41] - Plugin tool_v0.4 registered, path=./plugins/tool
[INFO][2023-05-26 04:24:14][plugin_manager.py:41] - Plugin Keyword_v0.1 registered, path=./plugins/keyword
[INFO][2023-05-26 04:24:14][plugin_manager.py:41] - Plugin Hello_v0.1 registered, path=./plugins/hello
[INFO][2023-05-26 04:24:14][plugin_manager.py:41] - Plugin Godcmd_v1.0 registered, path=./plugins/godcmd
[INFO][2023-05-26 04:24:14][plugin_manager.py:41] - Plugin Dungeon_v1.0 registered, path=./plugins/dungeon
[INFO][2023-05-26 04:24:14][plugin_manager.py:41] - Plugin Banwords_v1.0 registered, path=./plugins/banwords
[INFO][2023-05-26 04:24:15][plugin_manager.py:41] - Plugin Role_v1.0 registered, path=./plugins/role
[INFO][2023-05-26 04:24:15][plugin_manager.py:41] - Plugin Finish_v1.0 registered, path=./plugins/finish
[INFO][2023-05-26 04:24:15][plugin_manager.py:41] - Plugin BDunit_v0.1 registered, path=./plugins/bdunit
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin GODCMD not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin KEYWORD not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin BANWORDS not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin TOOL not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin ROLE not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin DUNGEON not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin BDUNIT not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin HELLO not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][plugin_manager.py:101] - Plugin FINISH not found in pconfig, adding to pconfig...
[INFO][2023-05-26 04:24:15][godcmd.py:181] - [Godcmd] 因未设置口令,本次的临时口令为2894。
[INFO][2023-05-26 04:24:15][godcmd.py:196] - [Godcmd] inited
[INFO][2023-05-26 04:24:15][keyword.py:40] - [keyword] {}
[INFO][2023-05-26 04:24:15][keyword.py:42] - [keyword] inited.
[WARNING][2023-05-26 04:24:15][banwords.py:53] - [Banwords] init failed, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/banwords .
[ERROR][2023-05-26 04:24:15][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-05-26 04:24:15][__init__.py:29] - [visual_dl] init failed, error_info: ModuleNotFoundError("No module named 'torch'")
[INFO][2023-05-26 04:24:15][__init__.py:29] - [visual_dl] init failed, error_info: ModuleNotFoundError("No module named 'torch'")
[WARNING][2023-05-26 04:24:16][chatgpt.py:171] - proxy no find, directly request to chatgpt instead
[WARNING][2023-05-26 04:24:16][chatgpt.py:171] - proxy no find, directly request to chatgpt instead
[INFO][2023-05-26 04:24:16][victorinox.py:86] - use_tools=['python', 'meteo-weather', 'terminal', 'url-get'], params: {'debug': False, 'openai_api_key': ' ', '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}
[INFO][2023-05-26 04:24:16][tool.py:32] - [tool] inited
[INFO][2023-05-26 04:24:16][role.py:69] - [Role] inited
[INFO][2023-05-26 04:24:16][dungeon.py:56] - [Dungeon] inited
[WARNING][2023-05-26 04:24:16][bdunit.py:47] - [BDunit] init failed, ignore
[ERROR][2023-05-26 04:24:16][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-05-26 04:24:16][hello.py:23] - [Hello] inited
[INFO][2023-05-26 04:24:16][finish.py:23] - [Finish] inited
Ready to login.
Getting uuid of QR code.
Downloading QR code.
You can also scan QRCode in any website below:
█▀▀▀▀▀▀▀█▀█▀██▀█▀▀█████▀▀▀▀▀▀▀█
█ █▀▀▀█ ██   ▀█ ▀█▀ ▄██ █▀▀▀█ █
█ █   █ █  █   █▀ ▀▀█▄█ █   █ █
█ ▀▀▀▀▀ █ █ ▄ ▄ █▀▄▀▄ █ ▀▀▀▀▀ █
█▀███▀█▀▀ █▄ ▄█  ▄ █▄ ▀▀▀▀▀██▀█
█▀▄▄▄▄ ▀▀  ▄ ▄▄▀ ▄█▄█▄█▄▄▄▄▄▄ █
█▄█ ▀██▀▀▀ ▀███▄▄▄ ▄▄ ▄█▄▄▄█ ▄█
███▀█▄ ▀▀▀▄▄▄▄ ▀▀▄▄ █▀█▄▄   ▄ █
██ ▄▄▀ ▀▄▄  ▄▄█ ▄▀ ▄█▀ █████ ▄█
█▄▄███▄▀▀▀█▀█▀█▀ ▄  ██▄ ▄ ▄▀▄ █
█▀▀▀▀▄▄▀▀ ▄ █▀█ █▄  █▀▀▀▀ ▀█▄ █
█▀▀▀▀▀▀▀█   ███▀ ▄▄ ▀ █▀█ ▀▀█ █
█ █▀▀▀█ █▀▄▀▄▀▀ ▀█ ▄  ▀▀▀ ▀█▄▀█
█ █   █ ██▀  █▀  ▄  █  ███▀▀▀ █
█ ▀▀▀▀▀ █▀▀▄▄▀█ ▀█ ▀█ ▀▄ █ █ ▄█
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Log in time out, reloading QR code.
Getting uuid of QR code.

环境

railway docker部署

goldfishh commented 1 year ago

看日志你的问题出现在

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
ChenWarlock commented 1 year ago

我也有一样的问题,无法加载搜索的tool。即使是单独用现在这个库也无法加载,请问你解决了吗