From bb6132eee120de3d8ab567c08c0ee7f72d20721f Mon Sep 17 00:00:00 2001 From: Jack Collins <6640905+jackmpcollins@users.noreply.github.com> Date: Sun, 5 May 2024 18:59:26 -0700 Subject: [PATCH] Fix: get format from data not optional_params ollama non-stream completion --- litellm/llms/ollama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/ollama.py b/litellm/llms/ollama.py index 03fb0134541..27c2aa618fe 100644 --- a/litellm/llms/ollama.py +++ b/litellm/llms/ollama.py @@ -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,