enh: query caching

Co-Authored-By: Jacob Leksan <63938553+jmleksan@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-08-27 03:07:21 +04:00
parent e4b6855984
commit 31485835a7
3 changed files with 10 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ from open_webui.env import (
CHAT_RESPONSE_MAX_TOOL_CALL_RETRIES,
BYPASS_MODEL_ACCESS_CONTROL,
ENABLE_REALTIME_CHAT_SAVE,
ENABLE_QUERIES_CACHE,
)
from open_webui.constants import TASKS
@@ -391,6 +392,9 @@ async def chat_web_search_handler(
except Exception as e:
queries = [response]
if ENABLE_QUERIES_CACHE:
request.state.cached_queries = queries
except Exception as e:
log.exception(e)
queries = [user_message]