mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
Fix: Set finish_reason to tool_calls for non-stream responses
This commit is contained in:
parent
22c9c5112b
commit
d02e9618f8
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
Add a link
Reference in a new issue