mirror of
https://github.com/open-webui/open-webui
synced 2025-06-25 17:57:20 +00:00
refac
This commit is contained in:
parent
9306ae5972
commit
b2befd486f
@ -1283,16 +1283,15 @@ async def generate_chat_completion(
|
|||||||
params = model_info.params.model_dump()
|
params = model_info.params.model_dump()
|
||||||
|
|
||||||
if params:
|
if params:
|
||||||
if payload.get("options") is None:
|
system = params.pop("system", None)
|
||||||
payload["options"] = {}
|
|
||||||
|
|
||||||
|
# Unlike OpenAI, Ollama does not support params directly in the body
|
||||||
payload["options"] = apply_model_params_to_body_ollama(
|
payload["options"] = apply_model_params_to_body_ollama(
|
||||||
params, payload["options"]
|
params, (payload.get("options", {}) or {})
|
||||||
)
|
|
||||||
payload = apply_model_system_prompt_to_body(
|
|
||||||
params.get("system"), payload, metadata, user
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
payload = apply_model_system_prompt_to_body(system, payload, metadata, user)
|
||||||
|
|
||||||
# Check if user has access to the model
|
# Check if user has access to the model
|
||||||
if not bypass_filter and user.role == "user":
|
if not bypass_filter and user.role == "user":
|
||||||
if not (
|
if not (
|
||||||
|
Loading…
Reference in New Issue
Block a user