Skip to content

Commit 033662f

Browse files
committed
test: document_parser.py
1 parent 196d3ef commit 033662f

File tree

2 files changed

+394
-0
lines changed

2 files changed

+394
-0
lines changed

autogen/agents/experimental/document_agent/ingestion/document_processor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def chunk_document(self, document_path: Path | str, chunk_size: int | None = Non
5050
with open(document_path, encoding="utf-8") as f:
5151
content = f.read()
5252

53+
# Handle empty content - return a single empty chunk
54+
if not content:
55+
return [""]
56+
5357
# Simple chunking by character count
5458
chunks = []
5559
for i in range(0, len(content), chunk_size):

0 commit comments

Comments
 (0)