From 214722d39e4948eaf5f8affb0db9e535ea8e35b5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 8 Sep 2024 00:51:12 +0100 Subject: [PATCH] enh: search query generation prompt --- backend/open_webui/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 9e6aa6fab..dbad78c25 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1454,10 +1454,11 @@ async def generate_search_query(form_data: dict, user=Depends(get_verified_user) else: template = """Assess the need for a web search based on the current question and prior interactions, but lean towards suggesting a Google search query if uncertain. Generate a Google search query even when the answer might be straightforward, as additional information may enhance comprehension or provide updated data. If absolutely certain that no further information is required, return an empty string. Default to a search query if unsure or in doubt. Today's date is {{CURRENT_DATE}}. -Interaction History: -{{MESSAGES:END:6}} Current Question: -{{prompt:end:4000}}""" +{{prompt:end:4000}} + +Interaction History: +{{MESSAGES:END:6}}""" content = search_query_generation_template( template, form_data["messages"], {"name": user.name}