更新安装文档,添加关于GitHub Models API的警告信息,并调整配置项说明

This commit is contained in:
2025-01-25 00:06:27 +08:00
parent c8e776d5ff
commit ef71514ce2
5 changed files with 94 additions and 12 deletions

View File

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