mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-12-25 18:56:42 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aebd6d7780 | |||
| 8e0af47c05 | |||
| f710ed4b8e | |||
| 39aa462483 |
@@ -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 | 否 | 无 | 进行推理时的核采样参数 |
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -78,7 +78,7 @@ class MarshoTools:
|
||||
json_path = os.path.join(package_path, 'tools.json')
|
||||
if os.path.exists(json_path):
|
||||
try:
|
||||
with open(json_path, 'r') as json_file:
|
||||
with open(json_path, 'r', encoding="utf-8") as json_file:
|
||||
data = json.load(json_file)
|
||||
for i in data:
|
||||
self.tools_list.append(i)
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "marshoai-basic__get_current_time",
|
||||
"description": "获取现在的时间。",
|
||||
"parameters": {
|
||||
}
|
||||
"description": "获取现在的时间。"
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user