chore: convert merge_docs_to_target_size to async

This commit is contained in:
DrMelone 2026-04-12 22:25:29 +02:00
parent f8364b840a
commit 777fa6ca89

View file

@ -1255,7 +1255,7 @@ def can_merge_chunks(a: Document, b: Document) -> bool:
return True
def merge_docs_to_target_size(
async def merge_docs_to_target_size(
request: Request,
chunks: list[Document],
) -> list[Document]:
@ -1436,7 +1436,7 @@ def save_docs_to_vector_db(
docs = split_docs
if request.app.state.config.CHUNK_MIN_SIZE_TARGET > 0:
docs = merge_docs_to_target_size(request, docs)
docs = await merge_docs_to_target_size(request, docs)
if request.app.state.config.TEXT_SPLITTER in ['', 'character']:
text_splitter = RecursiveCharacterTextSplitter(