From aebd6d7780bf6a25b31ca557d188d17bac7b2543 Mon Sep 17 00:00:00 2001 From: Asankilp Date: Sun, 24 Nov 2024 02:05:56 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=E6=96=B0=E5=A2=9E=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=86=85=E7=BD=AE=E5=B7=A5=E5=85=B7=E5=8C=85?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + nonebot_plugin_marshoai/azure.py | 3 ++- nonebot_plugin_marshoai/config.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 659dcf8..c149a18 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ _✨ 使用 OpenAI 标准格式 API 的聊天机器人插件 ✨_ | MARSHOAI_ENABLE_NICKNAME_TIP | 否 | `true` | 启用后用户未设置昵称时提示用户设置 | | MARSHOAI_ENABLE_PRAISES | 否 | `true` | 是否启用夸赞名单功能 | | MARSHOAI_ENABLE_TOOLS | 否 | `true` | 是否启用小棉工具(MarshoTools) | +| MARSHOAI_LOAD_BUILTIN_TOOLS | 否 | `true` | 是否加载内置工具包 | | MARSHOAI_AZURE_ENDPOINT | 否 | `https://models.inference.ai.azure.com` | OpenAI 标准格式 API 端点 | | MARSHOAI_TEMPERATURE | 否 | 无 | 进行推理时的温度参数 | | MARSHOAI_TOP_P | 否 | 无 | 进行推理时的核采样参数 | diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index 0e1c241..3561e4b 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -67,7 +67,8 @@ target_list = [] # 记录需保存历史上下文的列表 async def _preload_tools(): tools_dir = store.get_plugin_data_dir() / "tools" os.makedirs(tools_dir, exist_ok=True) - tools.load_tools(Path(__file__).parent / "tools") + if config.marshoai_load_builtin_tools: + tools.load_tools(Path(__file__).parent / "tools") tools.load_tools(store.get_plugin_data_dir() / "tools") @add_usermsg_cmd.handle() diff --git a/nonebot_plugin_marshoai/config.py b/nonebot_plugin_marshoai/config.py index 6f06aeb..438f0f2 100644 --- a/nonebot_plugin_marshoai/config.py +++ b/nonebot_plugin_marshoai/config.py @@ -25,6 +25,7 @@ class ConfigModel(BaseModel): marshoai_enable_praises: bool = True marshoai_enable_time_prompt: bool = True marshoai_enable_tools: bool = True + marshoai_load_builtin_tools: bool = True marshoai_azure_endpoint: str = "https://models.inference.ai.azure.com" marshoai_temperature: float | None = None marshoai_max_tokens: int | None = None