mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-07 00:27:12 +00:00
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:
1 parent
752c949009
commit
3d57f4396f
2 files changed
+45
-4
No files matched your search
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user