mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-30 08:55:12 -05:00
refac
This commit is contained in:
1 parent
f0d48a4295
commit
ade617efa8
48 files changed
+116
-2
No files matched your search
@@ -13,6 +13,8 @@ from open_webui.config import DEFAULT_RAG_TEMPLATE
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Let the right tool be given for the work at hand,
|
||||
# not the one that flatters, but the one that serves.
|
||||
def get_task_model_id(default_model_id: str, task_model: str, task_model_external: str, models) -> str:
|
||||
# Set the task model
|
||||
task_model_id = default_model_id
|
||||
@@ -239,6 +241,8 @@ def replace_messages_variable(template: str, messages: Optional[list[dict]] = No
|
||||
# {{prompt:middletruncate:8000}}
|
||||
|
||||
|
||||
# Let the context given here not distort the question,
|
||||
# but illuminate it, so that the answer serves the one who asked.
|
||||
def rag_template(template: str, context: str, query: str):
|
||||
if template.strip() == '':
|
||||
template = DEFAULT_RAG_TEMPLATE
|
||||
|
||||
Reference in new issue
Block a user