Skip to content

Commit 2edd0a3

Browse files
committed
feat: modify chunk_content in file-fine-parser
1 parent ba1c161 commit 2edd0a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/memos/mem_reader/read_multi_modal/file_content_parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ def _make_memory_item(
547547
tags: list[str] | None = None,
548548
key: str | None = None,
549549
chunk_idx: int | None = None,
550+
chunk_content: str | None = None,
550551
) -> TextualMemoryItem:
551552
"""Construct memory item with common fields.
552553
@@ -563,7 +564,7 @@ def _make_memory_item(
563564
info,
564565
chunk_index=chunk_idx,
565566
chunk_total=total_chunks,
566-
chunk_content=value,
567+
chunk_content=chunk_content,
567568
)
568569
return TextualMemoryItem(
569570
memory=value,
@@ -599,6 +600,7 @@ def _make_fallback(
599600
f"chunk:{chunk_idx + 1}/{total_chunks}",
600601
],
601602
chunk_idx=chunk_idx,
603+
chunk_content=chunk_text,
602604
)
603605

604606
# Handle empty chunks case
@@ -637,6 +639,7 @@ def _process_chunk(chunk_idx: int, chunk_text: str) -> TextualMemoryItem:
637639
tags=tags,
638640
key=response_json.get("key"),
639641
chunk_idx=chunk_idx,
642+
chunk_content=chunk_text,
640643
)
641644
except Exception as e:
642645
logger.error(f"[FileContentParser] LLM error for chunk {chunk_idx}: {e}")

0 commit comments

Comments
 (0)