mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-27 07:39:20 -05:00
refac: prompt variables
This commit is contained in:
1 parent
d6c82939e6
commit
cc99673906
8 files changed
+49
-18
No files matched your search
@@ -32,6 +32,12 @@ def get_task_model_id(
|
||||
return task_model_id
|
||||
|
||||
|
||||
def prompt_variables_template(template: str, variables: dict[str, str]) -> str:
|
||||
for variable, value in variables.items():
|
||||
template = template.replace(variable, value)
|
||||
return template
|
||||
|
||||
|
||||
def prompt_template(
|
||||
template: str, user_name: Optional[str] = None, user_location: Optional[str] = None
|
||||
) -> str:
|
||||
|
||||
Reference in new issue
Block a user