mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 05:15:18 +00:00
refac
This commit is contained in:
parent
057ca6a339
commit
1df9305bc7
1 changed files with 4 additions and 0 deletions
|
|
@ -297,6 +297,10 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
|
||||||
if "tools" in openai_payload:
|
if "tools" in openai_payload:
|
||||||
ollama_payload["tools"] = openai_payload["tools"]
|
ollama_payload["tools"] = openai_payload["tools"]
|
||||||
|
|
||||||
|
if "max_tokens" in openai_payload:
|
||||||
|
ollama_payload["num_predict"] = openai_payload["max_tokens"]
|
||||||
|
del openai_payload["max_tokens"]
|
||||||
|
|
||||||
# If there are advanced parameters in the payload, format them in Ollama's options field
|
# If there are advanced parameters in the payload, format them in Ollama's options field
|
||||||
if openai_payload.get("options"):
|
if openai_payload.get("options"):
|
||||||
ollama_payload["options"] = openai_payload["options"]
|
ollama_payload["options"] = openai_payload["options"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue