mirror of
https://github.com/open-webui/open-webui
synced 2025-03-04 19:38:54 +00:00
Merge pull request #10521 from Seniorsimo/add-stop-parameter
**fix** Added support for stop parameter in OpenAI to Ollama conversion
This commit is contained in:
commit
086a78f863
@ -230,6 +230,12 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
|
||||
"system"
|
||||
] # To prevent Ollama warning of invalid option provided
|
||||
|
||||
# If there is the "stop" parameter in the openai_payload, remap it to the ollama_payload.options
|
||||
if "stop" in openai_payload:
|
||||
ollama_options = ollama_payload.get("options", {})
|
||||
ollama_options["stop"] = openai_payload.get("stop")
|
||||
ollama_payload["options"] = ollama_options
|
||||
|
||||
if "metadata" in openai_payload:
|
||||
ollama_payload["metadata"] = openai_payload["metadata"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user