Skip to content

Commit

Permalink
✨新增控制加载内置工具包的配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
Asankilp committed Nov 23, 2024
1 parent 8e0af47 commit aebd6d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||| 进行推理时的核采样参数 |
Expand Down
3 changes: 2 additions & 1 deletion nonebot_plugin_marshoai/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
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()
Expand Down
1 change: 1 addition & 0 deletions nonebot_plugin_marshoai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aebd6d7

Please sign in to comment.