mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-07-31 08:59:51 +00:00
✨ 更新安装文档,添加关于GitHub Models API的警告信息,并调整配置项说明
This commit is contained in:
@ -13,9 +13,9 @@ class ConfigModel(BaseModel):
|
||||
# marshoai_support_image_models: list = ["gpt-4o","gpt-4o-mini"]
|
||||
marshoai_default_name: str = "marsho"
|
||||
marshoai_at: bool = False
|
||||
marshoai_aliases: set[str] = {
|
||||
marshoai_aliases: list[str] = [
|
||||
"小棉",
|
||||
}
|
||||
]
|
||||
marshoai_main_colour: str = "FFAAAA"
|
||||
marshoai_default_model: str = "gpt-4o-mini"
|
||||
marshoai_prompt: str = (
|
||||
@ -40,6 +40,7 @@ class ConfigModel(BaseModel):
|
||||
marshoai_enable_tools: bool = False
|
||||
marshoai_enable_plugins: bool = True
|
||||
marshoai_load_builtin_tools: bool = True
|
||||
marshoai_fix_toolcalls: bool = True
|
||||
marshoai_toolset_dir: list = []
|
||||
marshoai_disabled_toolkits: list = []
|
||||
marshoai_azure_endpoint: str = "https://models.inference.ai.azure.com"
|
||||
|
@ -292,7 +292,7 @@ async def marsho(
|
||||
choice = response.choices[0]
|
||||
# Sprint(choice)
|
||||
# 当tool_calls非空时,将finish_reason设置为TOOL_CALLS
|
||||
if choice.message.tool_calls != None:
|
||||
if choice.message.tool_calls != None and config.marshoai_fix_toolcalls:
|
||||
choice["finish_reason"] = CompletionsFinishReason.TOOL_CALLS
|
||||
if choice["finish_reason"] == CompletionsFinishReason.STOPPED:
|
||||
# 当对话成功时,将dict的上下文添加到上下文类中
|
||||
@ -325,10 +325,13 @@ async def marsho(
|
||||
while choice.message.tool_calls != None:
|
||||
# await UniMessage(str(response)).send()
|
||||
tool_calls = choice.message.tool_calls
|
||||
if tool_calls[0]["function"]["name"].startswith("$"):
|
||||
choice.message.tool_calls[0][
|
||||
"type"
|
||||
] = "builtin_function" # 兼容 moonshot AI 内置函数的临时方案
|
||||
try:
|
||||
if tool_calls[0]["function"]["name"].startswith("$"):
|
||||
choice.message.tool_calls[0][
|
||||
"type"
|
||||
] = "builtin_function" # 兼容 moonshot AI 内置函数的临时方案
|
||||
except:
|
||||
pass
|
||||
tool_msg.append(choice.message.as_dict())
|
||||
for tool_call in tool_calls:
|
||||
if isinstance(
|
||||
|
Reference in New Issue
Block a user