fix:deepseek tool call not working correctly (#12437)

This commit is contained in:
呆萌闷油瓶 2025-01-07 17:25:38 +08:00 committed by GitHub
parent 15797c556f
commit 9677144015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -377,6 +377,9 @@ class OAIAPICompatLargeLanguageModel(_CommonOaiApiCompat, LargeLanguageModel):
for tool in tools: for tool in tools:
formatted_tools.append(helper.dump_model(PromptMessageFunction(function=tool))) formatted_tools.append(helper.dump_model(PromptMessageFunction(function=tool)))
if prompt_messages[-1].role.value == "tool":
data["tools"] = None
else:
data["tools"] = formatted_tools data["tools"] = formatted_tools
if stop: if stop: