Fix: Set finish_reason to tool_calls for non-stream responses

This commit is contained in:
Jack Collins 2024-05-05 18:47:58 -07:00
parent 22c9c5112b
commit d02e9618f8

View file

@ -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"]