mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
Fix: Set finish_reason to tool_calls for non-stream responses
This commit is contained in:
parent
107a77368f
commit
c217a07d5e
1 changed files with 2 additions and 0 deletions
|
|
@ -298,6 +298,7 @@ def get_ollama_response(
|
|||
],
|
||||
)
|
||||
model_response["choices"][0]["message"] = message
|
||||
model_response["choices"][0]["finish_reason"] = "tool_calls"
|
||||
else:
|
||||
model_response["choices"][0]["message"] = response_json["message"]
|
||||
model_response["created"] = int(time.time())
|
||||
|
|
@ -480,6 +481,7 @@ async def ollama_acompletion(
|
|||
],
|
||||
)
|
||||
model_response["choices"][0]["message"] = message
|
||||
model_response["choices"][0]["finish_reason"] = "tool_calls"
|
||||
else:
|
||||
model_response["choices"][0]["message"] = response_json["message"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue