🔥 移除对moonshot内置函数的临时兼容处理代码

This commit is contained in:
Asankilp 2025-02-10 23:54:01 +08:00
parent 685f813e22
commit c97cf68393

View File

@ -340,13 +340,13 @@ async def marsho(
while choice.message.tool_calls != None: while choice.message.tool_calls != None:
# await UniMessage(str(response)).send() # await UniMessage(str(response)).send()
tool_calls = choice.message.tool_calls tool_calls = choice.message.tool_calls
try: # try:
if tool_calls[0]["function"]["name"].startswith("$"): # if tool_calls[0]["function"]["name"].startswith("$"):
choice.message.tool_calls[0][ # choice.message.tool_calls[0][
"type" # "type"
] = "builtin_function" # 兼容 moonshot AI 内置函数的临时方案 # ] = "builtin_function" # 兼容 moonshot AI 内置函数的临时方案
except: # except:
pass # pass
tool_msg.append(choice.message) tool_msg.append(choice.message)
for tool_call in tool_calls: for tool_call in tool_calls:
try: try: