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
co-authored by Jacob Leksan
parent e4b6855984
commit 31485835a7
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -470,6 +470,10 @@ async def generate_queries(
detail=f"Query generation is disabled",
)
if getattr(request.state, "cached_queries", None):
log.info(f"Reusing cached queries: {request.state.cached_queries}")
return request.state.cached_queries
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,