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.85k stars 8.07k forks source link

searxng-search插件配置成功,但是启动机器人加载时,却显示没有这个插件,其他插件都没问题 #1629

Closed xiaobu159 closed 2 months ago

xiaobu159 commented 10 months ago

前置确认

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

操作系统类型?

Docker

运行的python版本是?

python 3.7

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

Latest Release

运行的channel类型是?

wxy(个人微信, wechaty)

复现步骤 🕹

{ "tools": [ "python", "url-get", "terminal", "meteo-weather", "wikipedia", "arxiv", "summary", "wolfram-alpha", "google-search", "searxng-search" ], "kwargs": { "top_k_results": 2, "no_default": false, "debug": true, "THINK_DEPTH":3, "REQUEST_TIMEOUT":90, "model_name": "gpt-3.5-turbo", "wolfram_alpha_appid": "", "google_api_key": "", "google_cse_id": "", "arxiv_summary": false, "searx_search_host": "http://192.168.2.188:8069" } }

问题描述 😯

image image

终端日志 📒

use_tools=['google-search', 'url-get', 'wolfram-alpha', 'wikipedia', 'arxiv', 'meteo-weather', 'python', 'terminal', 'summary']
XueJourney commented 10 months ago

有些插件不会自动加载,要自己使用 #enable启动

xiaobu159 commented 2 months ago

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。

continentlht commented 2 months ago

同问 image

continentlht commented 2 months ago

image

piwawa commented 2 weeks ago

现在还有这个问题,$tool reset 之后,后台会显示:

[tool] filter invalid tool: 'searxng-search'

image

这是我的 /root/chatgpt-on-wechat/plugins/tool/config.json 配置:

{
  "tools": [
    "url-get",
    "meteo",
    "searxng-search",
    "arxiv",
    "wikipedia",
    "finance-news"
  ],
  "kwargs": {
    "debug": false,
    "no_default": false,
    "model_name": "gpt-4o",
    "searxng_search_host": "https://"
  }
}

另外 arxiv finance-news 也是报错:

[DEBUG][2024-10-10 11:13:23][chat_channel.py:170] - [chat_channel] ready to handle context: Context(type=TEXT, content=$tool  arxiv 666, kwargs={'isgroup': F
alse, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x7f24fee366d0>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_mode
l': None, 'session_id': '@12ed000bd048be0e4d946c377c9a3cb98cd4150268a45556de38793c8ba98224', 'receiver': '@12ed000bd048be0e4d946c377c9a3cb98cd4150268a45556de
38793c8ba98224'})
[DEBUG][2024-10-10 11:13:23][plugin_manager.py:189] - Plugin GODCMD triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:13:23][godcmd.py:220] - [Godcmd] on_handle_context. content: $tool  arxiv 666
[DEBUG][2024-10-10 11:13:23][plugin_manager.py:189] - Plugin KEYWORD triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:13:23][keyword.py:52] - [keyword] on_handle_context. content: $tool  arxiv 666
[DEBUG][2024-10-10 11:13:23][plugin_manager.py:189] - Plugin LINKAI triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:13:23][plugin_manager.py:189] - Plugin TOOL triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:13:23][tool.py:69] - [tool] on_handle_context. content: $tool  arxiv 666
[DEBUG][2024-10-10 11:13:23][session_manager.py:70] - prompt tokens used=302
[DEBUG][2024-10-10 11:13:23][tool.py:108] - [tool]: just-go
[ERROR][2024-10-10 11:13:25][tool.py:120] - Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/root/chatgpt-on-wechat/plugins/tool/tool.py", line 113, in on_handle_context
    _reply = tool.run(query)
  File "/root/miniconda3/envs/wechat/lib/python3.8/site-packages/chatgpt_tool_hub/tools/base_tool.py", line 75, in run
    raise e
  File "/root/miniconda3/envs/wechat/lib/python3.8/site-packages/chatgpt_tool_hub/tools/base_tool.py", line 72, in run
    observation = self._run(tool_input)
  File "/root/miniconda3/envs/wechat/lib/python3.8/site-packages/chatgpt_tool_hub/tools/arxiv_search/tool.py", line 50, in _run
    _api_response = self.api_wrapper.run(_llm_response)
  File "/root/miniconda3/envs/wechat/lib/python3.8/site-packages/chatgpt_tool_hub/tools/arxiv_search/wrapper.py", line 76, in run
    query_json = json.loads(query_json_str)
  File "/root/miniconda3/envs/wechat/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/root/miniconda3/envs/wechat/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/root/miniconda3/envs/wechat/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[ERROR][2024-10-10 11:13:25][tool.py:121] - Expecting value: line 1 column 1 (char 0)
[DEBUG][2024-10-10 11:13:25][plugin_manager.py:194] - Plugin TOOL breaked event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:13:25][chat_channel.py:192] - [chat_channel] ready to handle context: type=TEXT, content=请你随机用一种聊天风格,提醒用户:这个问题tool插件暂时无法处理
[DEBUG][2024-10-10 11:14:23][plugin_manager.py:189] - Plugin GODCMD triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:14:23][godcmd.py:220] - [Godcmd] on_handle_context. content: $tool  finance-news
[DEBUG][2024-10-10 11:14:23][plugin_manager.py:189] - Plugin KEYWORD triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:14:23][keyword.py:52] - [keyword] on_handle_context. content: $tool  finance-news
[DEBUG][2024-10-10 11:14:23][plugin_manager.py:189] - Plugin LINKAI triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:14:23][plugin_manager.py:189] - Plugin TOOL triggered by event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:14:23][tool.py:69] - [tool] on_handle_context. content: $tool  finance-news
[DEBUG][2024-10-10 11:14:23][session_manager.py:70] - prompt tokens used=442
[DEBUG][2024-10-10 11:14:23][tool.py:108] - [tool]: just-go

[DEBUG][2024-10-10 11:15:02][session_manager.py:81] - raw total_tokens=None, savesession tokens=452
[DEBUG][2024-10-10 11:15:02][plugin_manager.py:194] - Plugin TOOL breaked event Event.ON_HANDLE_CONTEXT
[DEBUG][2024-10-10 11:15:02][chat_channel.py:174] - [chat_channel] ready to decorate reply: Reply(type=TEXT, content=出错,看日志)
[DEBUG][2024-10-10 11:15:02][chat_channel.py:286] - [chat_channel] ready to send reply: Reply(type=TEXT, content=出错,看日志), context: Context(type=TEXT, content=$tool  finance-news, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x7f24feee8f40>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@12ed000bd048be0e4d946c377c9a3cb98cd4150268a45556de38793c8ba98224', 'receiver': '@12ed000bd048be0e4d946c377c9a3cb98cd4150268a45556de38793c8ba98224'})
[INFO][2024-10-10 11:15:02][wechat_channel.py:217] - [WX] sendMsg=Reply(type=TEXT, content=出错,看日志), receiver=@12ed000bd048be0e4d946c377c9a3cb98cd4150268a45556de38793c8ba98224
[DEBUG][2024-10-10 11:15:02][chat_channel.py:302] - Worker return success, session_id = @12ed000bd048be0e4d946c377c9a3cb98cd4150268a45556de38793c8ba98224

最后一个问题,这里的 model_name 设置是啥意思?不设置是不是自动使用主 config 的 LLM?

xiaobu159 commented 2 weeks ago

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。