Fix: get format from data not optional_params ollama non-stream completion

This commit is contained in:
Jack Collins 2024-05-05 18:59:26 -07:00
parent 81b1c46c6f
commit bb6132eee1

View file

@ -213,7 +213,7 @@ def get_ollama_response(
## RESPONSE OBJECT
model_response["choices"][0]["finish_reason"] = "stop"
if optional_params.get("format", "") == "json":
if data.get("format", "") == "json":
function_call = json.loads(response_json["response"])
message = litellm.Message(
content=None,