Remove empty ollama_options

1) The empty dictionary from line 176 is never used.
2) Lines 193-194 are not necessary as they were already done at line 177
This commit is contained in:
ferret99gt 2025-02-19 08:57:05 -05:00
parent 57b01cf8fb
commit 8125b0499b

View File

@ -173,8 +173,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
ollama_payload["format"] = openai_payload["format"]
# If there are advanced parameters in the payload, format them in Ollama's options field
ollama_options = {}
if openai_payload.get("options"):
ollama_payload["options"] = openai_payload["options"]
ollama_options = openai_payload["options"]
@ -189,10 +187,6 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
ollama_payload["system"] = ollama_options["system"]
del ollama_options["system"] # To prevent Ollama warning of invalid option provided
# Add options to payload if any have been set
if ollama_options:
ollama_payload["options"] = ollama_options
if "metadata" in openai_payload:
ollama_payload["metadata"] = openai_payload["metadata"]