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:
@ -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