agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

[Bug]:OpenAITextEmbedding 组件存在设计缺陷

Open jackxmcheng opened this issue 8 months ago • 3 comments

OpenAITextEmbedding 组件存在设计缺陷:强制要求传入 dimensions 向量维度参数,并默认携带该参数调用接口,未区分模型兼容性。 该参数仅 OpenAI 官方嵌入模型支持,BAAI/bge 等开源嵌入模型不支持 matryoshka representation 嵌套向量功能,携带 dimensions 调用会直接返回 400 错误,导致开源模型无法使用。 复现方式 使用 OpenAITextEmbedding 调用开源嵌入模型(如 BAAI/bge-large-zh-v1.5),框架自动携带 dimensions 参数,接口报错: Model "BAAI/bge-large-zh-v1.5" does not support matryoshka representation... 影响范围 所有非 OpenAI 官方嵌入模型均无法通过 OpenAITextEmbedding 正常调用,严重限制框架对开源嵌入模型的支持。 修复建议 将 dimensions 改为非必选参数,默认不传递; 仅当用户显式配置时,才携带该参数; 增加模型兼容性判断,仅对 OpenAI 官方模型支持 dimensions 配置。

jackxmcheng avatar Apr 01 '26 03:04 jackxmcheng

Hi, I’d like to work on this issue as my first contribution.

My understanding is:

  • make dimensions optional in OpenAITextEmbedding
  • only send it when explicitly configured
  • add/update unit tests for this behavior

Please let me know if this direction looks good. Thanks!

guslegend0510 avatar May 22 '26 11:05 guslegend0510

Hi, I wanted to work on this issue as my first contribution.

Thanks!

Asaduddin18 avatar Jul 11 '26 04:07 Asaduddin18

I'd like to pick this up and implement the fix: make dimensions optional in OpenAITextEmbedding, only send it when explicitly configured, and add/update unit tests. The previous assignee claim appears inactive — happy to coordinate if a PR is already in progress.

Blue-Berrys avatar Jul 27 '26 14:07 Blue-Berrys