mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-05 04:56:17 +01:00
Truncate similar docs content
This commit is contained in:
parent
62e04ab2fe
commit
90bd878cf2
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ def get_context_for_document(
|
|||
)[:max_docs]
|
||||
context_blocks = []
|
||||
for similar in similar_docs:
|
||||
text = similar.content or ""
|
||||
text = similar.content[:1000] or ""
|
||||
title = similar.title or similar.filename or "Untitled"
|
||||
context_blocks.append(f"TITLE: {title}\n{text}")
|
||||
return "\n\n".join(context_blocks)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue