mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 03:59:51 +00:00
✨新增禁用工具包的配置项
This commit is contained in:
@ -39,6 +39,7 @@ class ConfigModel(BaseModel):
|
||||
marshoai_enable_tools: bool = True
|
||||
marshoai_load_builtin_tools: bool = True
|
||||
marshoai_toolset_dir: list = []
|
||||
marshoai_disabled_toolkits: list = []
|
||||
marshoai_azure_endpoint: str = "https://models.inference.ai.azure.com"
|
||||
marshoai_temperature: float | None = None
|
||||
marshoai_max_tokens: int | None = None
|
||||
|
@ -40,6 +40,8 @@ marshoai_load_builtin_tools: true # 是否加载内置工具。
|
||||
|
||||
marshoai_toolset_dir: [] # 工具集路径。
|
||||
|
||||
marshoai_disabled_toolkits: [] # 已禁用的工具包列表。
|
||||
|
||||
marshoai_azure_endpoint: "https://models.inference.ai.azure.com" # OpenAI 标准格式 API 的端点。
|
||||
|
||||
# 模型参数配置
|
||||
|
@ -75,8 +75,10 @@ class MarshoTools:
|
||||
for package_name in os.listdir(tools_dir):
|
||||
package_path = os.path.join(tools_dir, package_name)
|
||||
|
||||
logger.info(f"尝试加载工具包 {package_name}")
|
||||
|
||||
# logger.info(f"尝试加载工具包 {package_name}")
|
||||
if package_name in config.marshoai_disabled_toolkits:
|
||||
logger.info(f"工具包 {package_name} 已被禁用。")
|
||||
continue
|
||||
if os.path.isdir(package_path) and os.path.exists(
|
||||
os.path.join(package_path, "__init__.py")
|
||||
):
|
||||
|
Reference in New Issue
Block a user