Skip to content

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

Description

@jackxmcheng

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 配置。

Activity

  1. added
    bug
    on Apr 1, 2026
  2. added theissue type on Apr 3, 2026
  3. added a commit that references this issue on Apr 29, 2026
    3e99a3b
  4. moved this from Backlog to In progress in AgentScope Javaon May 19, 2026
  5. guslegend0510 commented on May 22, 2026

    @guslegend0510
    Contributor

    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!

  6. added
    area/ext/rag
    on May 28, 2026
  7. Asaduddin18 commented on Jul 11, 2026

    @Asaduddin18

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

    Thanks!

  8. Blue-Berrys commented on Jul 27, 2026

    @Blue-Berrys
    Contributor

    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.

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

Metadata

Metadata

Assignees

Labels

area/ext/ragbuggood first issue

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions