Fix: key the AI suggestion cache by model and endpoint (#13449)

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Matthias Breddin
2026-07-31 16:13:22 +00:00
committed by GitHub
co-authored by shamoon
parent 752c949009
commit 3d57f4396f
2 changed files with 45 additions and 4 deletions
+9 -4
View File
@@ -1530,10 +1530,15 @@ class DocumentViewSet(
return HttpResponseBadRequest("AI is required for this feature")
output_language = _get_llm_output_language(ai_config=ai_config, request=request)
llm_cache_backend = (
f"{ai_config.llm_backend}:{output_language}"
if output_language
else ai_config.llm_backend
llm_cache_backend = ":".join(
part
for part in (
ai_config.llm_backend,
ai_config.llm_model,
ai_config.llm_endpoint,
output_language,
)
if part
)
cached_llm_suggestions = get_llm_suggestion_cache(