From ed2dd8a5e08ac6b8d456235140df2860f3657de1 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Tue, 12 Aug 2025 14:07:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96Web=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E5=92=8CURL=E8=A7=A3=E6=9E=90=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=9A=84=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=92=E4=BB=B6=E9=85=8D=E7=BD=AE=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=94=AF=E6=8C=81=EF=BC=8C=E8=B0=83=E6=95=B4=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=95=B0=E9=87=8F=E5=92=8C=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/built_in/WEB_SEARCH_TOOL/plugin.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/built_in/WEB_SEARCH_TOOL/plugin.py b/src/plugins/built_in/WEB_SEARCH_TOOL/plugin.py index 39d4f821a..c12415f80 100644 --- a/src/plugins/built_in/WEB_SEARCH_TOOL/plugin.py +++ b/src/plugins/built_in/WEB_SEARCH_TOOL/plugin.py @@ -37,13 +37,13 @@ class WebSurfingTool(BaseTool): available_for_llm: bool = True parameters = [ ("query", ToolParamType.STRING, "要搜索的关键词或问题。", True, None), - ("num_results", ToolParamType.INTEGER, "期望每个搜索引擎返回的搜索结果数量,默认为5。", False, "5"), - ("time_range", ToolParamType.STRING, "指定搜索的时间范围,可以是 'any', 'week', 'month'。默认为 'any'。", False, "any") + ("num_results", ToolParamType.INTEGER, "期望每个搜索引擎返回的搜索结果数量,默认为5。", False, None), + ("time_range", ToolParamType.STRING, "指定搜索的时间范围,可以是 'any', 'week', 'month'。默认为 'any'。", False, ["any", "week", "month"]) ] # type: ignore - def __init__(self): + def __init__(self, plugin_config=None): + super().__init__(plugin_config) EXA_API_KEY = self.get_config("exa.api_key", None) - super().__init__() self.exa = Exa(api_key=EXA_API_KEY) if EXA_API_KEY else None if not self.exa: @@ -174,8 +174,8 @@ class URLParserTool(BaseTool): parameters = [ ("urls", ToolParamType.STRING, "要理解的网站", True, None), ] - def __init__(self): - super().__init__() + def __init__(self, plugin_config=None): + super().__init__(plugin_config) EXA_API_KEY = self.get_config("exa.api_key", None) if not EXA_API_KEY or EXA_API_KEY == "YOUR_API_KEY_HERE": self.exa = None