refac: "tool_calls" finish reason support

This commit is contained in:
Timothy Jaeryang Baek
2026-02-16 00:53:01 -06:00
parent 09dc28df1e
commit f4e99c80f6
2 changed files with 4 additions and 1 deletions

View File

@@ -447,7 +447,7 @@ def openai_chat_completion_message_template(
**({"tool_calls": tool_calls} if tool_calls else {}),
}
template["choices"][0]["finish_reason"] = "stop"
template["choices"][0]["finish_reason"] = "tool_calls" if tool_calls else "stop"
if usage:
template["usage"] = usage