mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 06:19:29 +00:00
fix(ollama.py): support format for ollama
This commit is contained in:
@@ -146,7 +146,15 @@ def get_ollama_response(
|
||||
optional_params[k] = v
|
||||
|
||||
stream = optional_params.pop("stream", False)
|
||||
data = {"model": model, "prompt": prompt, "options": optional_params}
|
||||
format = optional_params.pop("format", None)
|
||||
data = {
|
||||
"model": model,
|
||||
"prompt": prompt,
|
||||
"options": optional_params,
|
||||
"stream": stream,
|
||||
}
|
||||
if format is not None:
|
||||
data["format"] = format
|
||||
|
||||
## LOGGING
|
||||
logging_obj.pre_call(
|
||||
|
||||
@@ -146,12 +146,15 @@ def get_ollama_response(
|
||||
optional_params[k] = v
|
||||
|
||||
stream = optional_params.pop("stream", False)
|
||||
format = optional_params.pop("format", None)
|
||||
data = {
|
||||
"model": model,
|
||||
"messages": messages,
|
||||
"options": optional_params,
|
||||
"stream": stream,
|
||||
}
|
||||
if format is not None:
|
||||
data["format"] = format
|
||||
## LOGGING
|
||||
logging_obj.pre_call(
|
||||
input=None,
|
||||
|
||||
Reference in New Issue
Block a user