mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-20 17:53:20 +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:
co-authored by
shamoon
parent
752c949009
commit
3d57f4396f
@@ -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