Skip to content

支持配置 Embedding 批次大小(修复 DashScope 批次上限报错)#10

Open
darkerwork wants to merge 1 commit intohsingjui:mainfrom
darkerwork:fix/embedding-batch-size-config
Open

支持配置 Embedding 批次大小(修复 DashScope 批次上限报错)#10
darkerwork wants to merge 1 commit intohsingjui:mainfrom
darkerwork:fix/embedding-batch-size-config

Conversation

@darkerwork
Copy link
Copy Markdown

背景

DashScope 兼容 Embedding 接口单次 input 上限为 10,当前索引流程固定使用 20,导致 contextweaver index 报 400。

变更

  • 新增 EMBEDDINGS_BATCH_SIZE(默认 10
  • EmbeddingConfig 增加 batchSize
  • getEmbeddingConfig() 读取并校验 EMBEDDINGS_BATCH_SIZE
  • Indexer.batchIndex() 改为使用配置值,而非硬编码 20
  • EmbeddingClient.embedBatch() 默认 batchSize 改为配置项
  • 更新 CLI init / MCP 默认 .env 模板与 README

验证

  • DashScope 配置下:EMBEDDINGS_BASE_URL=.../v1/embeddings + EMBEDDINGS_BATCH_SIZE=10
  • contextweaver index 不再触发 batch size invalid 错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant