From ea32b62f8246911628d0ee9865bb5cba38ea74fb Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 19 Jun 2026 15:31:44 +0200 Subject: [PATCH] feat: add cited line range to by-chunk response --- surfsense_backend/app/schemas/documents.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/surfsense_backend/app/schemas/documents.py b/surfsense_backend/app/schemas/documents.py index 49d2836b2..162dd6882 100644 --- a/surfsense_backend/app/schemas/documents.py +++ b/surfsense_backend/app/schemas/documents.py @@ -73,6 +73,10 @@ class DocumentWithChunksRead(DocumentRead): chunks: list[ChunkRead] = [] total_chunks: int = 0 chunk_start_index: int = 0 + # 1-based inclusive line range of the cited chunk within source_markdown; + # None when the chunk predates char spans or the body is unavailable. + cited_start_line: int | None = None + cited_end_line: int | None = None model_config = ConfigDict(from_attributes=True)