mirror of
https://github.com/open-webui/open-webui
synced 2025-02-23 13:51:07 +00:00
refac
This commit is contained in:
parent
b935a839fe
commit
63a5ee3adb
@ -14,6 +14,12 @@ def apply_model_system_prompt_to_body(
|
||||
if not system:
|
||||
return form_data
|
||||
|
||||
# Metadata (WebUI Usage)
|
||||
if metadata:
|
||||
variables = metadata.get("variables", {})
|
||||
if variables:
|
||||
system = prompt_variables_template(system, variables)
|
||||
|
||||
# Legacy (API Usage)
|
||||
if user:
|
||||
template_params = {
|
||||
@ -25,12 +31,6 @@ def apply_model_system_prompt_to_body(
|
||||
|
||||
system = prompt_template(system, **template_params)
|
||||
|
||||
# Metadata (WebUI Usage)
|
||||
if metadata:
|
||||
variables = metadata.get("variables", {})
|
||||
if variables:
|
||||
system = prompt_variables_template(system, variables)
|
||||
|
||||
form_data["messages"] = add_or_update_system_message(
|
||||
system, form_data.get("messages", [])
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user