Skip to content

Commit 37484bc

Browse files
committed
feat(chunking): implement holistic chunking mechanism
1 parent 0a3fdd3 commit 37484bc

File tree

2 files changed

+322
-105
lines changed

2 files changed

+322
-105
lines changed

examples/code_embedding/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def code_to_embedding(
2727
@cocoindex.flow_def(name="CodeEmbedding")
2828
def code_embedding_flow(
2929
flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope
30-
):
30+
) -> None:
3131
"""
3232
Define an example flow that embeds files into a vector database.
3333
"""
@@ -46,6 +46,7 @@ def code_embedding_flow(
4646
cocoindex.functions.SplitRecursively(),
4747
language=file["extension"],
4848
chunk_size=1000,
49+
min_chunk_size=300,
4950
chunk_overlap=300,
5051
)
5152
with file["chunks"].row() as chunk:

0 commit comments

Comments
 (0)