fix: honor dashscope embedding batch limit

This commit is contained in:
gqt
2026-07-13 12:16:09 +08:00
parent 6e3f4b8d04
commit 52184aa00e
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ class IndexWorker:
await self._mark_failed(document_id, "INDEXING_FAILED", "文档索引失败,请重试")
async def _embed_and_upsert(self, document_id: str, chunks: list[PreparedChunk]) -> bool:
batch_size = 20
batch_size = 10
for start in range(0, len(chunks), batch_size):
batch = chunks[start : start + batch_size]
vectors = await self.embeddings.embed_documents([chunk.content for chunk in batch])