Skip to content

feat: add MiniMax provider catalog support - #1918

Open
octo-patch wants to merge 2 commits into
SuanmoSuanyangTechnology:mainfrom
octo-patch:octo/20260802-provider-add-recvqjePIxt3Hu
Open

feat: add MiniMax provider catalog support#1918
octo-patch wants to merge 2 commits into
SuanmoSuanyangTechnology:mainfrom
octo-patch:octo/20260802-provider-add-recvqjePIxt3Hu

Conversation

@octo-patch

@octo-patch octo-patch commented Aug 2, 2026

Copy link
Copy Markdown

Reason: Add MiniMax provider support to the model catalog and OpenAI-compatible runtime routing.

Changes:

  • Added the MiniMax provider enum value.
  • Routed MiniMax through the OpenAI-compatible LLM and embedding paths.
  • Enabled MiniMax in the workflow multimodal provider allowlist.
  • Added MiniMax-M3 and MiniMax-M2.7 catalog entries with the requested capabilities.

Checks:

  • python -m compileall for the patched Python modules.
  • uv run python source-level verification of the new provider enum, runtime routing, and catalog file.

Summary by Sourcery

在模型目录和运行时路由中添加对 MiniMax 的支持。

新功能:

  • 在模型提供方枚举和多模态提供方允许列表中引入 MiniMax 提供方。
  • 通过兼容 OpenAI 的 LLM 和 embedding 实现,为 MiniMax 添加路由支持。
  • 在目录中注册 MiniMax-M3 和 MiniMax-M2.7 模型,提供多模态和大上下文能力。
Original summary in English

Summary by Sourcery

Add MiniMax as a supported provider across the model catalog and runtime routing.

New Features:

  • Introduce the MiniMax provider to the model provider enumeration and multimodal provider allowlist.
  • Add routing support for MiniMax through the OpenAI-compatible LLM and embedding implementations.
  • Register MiniMax-M3 and MiniMax-M2.7 models in the catalog with multimodal and large-context capabilities.

@sourcery-ai

sourcery-ai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

在模型提供者枚举中增加 MiniMax 作为受支持的提供者,通过兼容 OpenAI 的路径为 LLM 和 Embeddings 提供路由,允许在多模态工作流白名单中使用,并引入专门的 MiniMax catalog YAML,其中包含两个模型及其能力元数据。

通过 OpenAI 兼容路径进行 MiniMax 路由的序列图

sequenceDiagram
  actor User
  participant BaseModels as get_provider_llm_class
  participant EmbeddingsFactory as get_provider_embedding_class

  User->>BaseModels: get_provider_llm_class(ModelProvider.MINIMAX)
  BaseModels-->>User: CompatibleChatOpenAI

  User->>EmbeddingsFactory: get_provider_embedding_class(ModelProvider.MINIMAX)
  EmbeddingsFactory-->>User: OpenAIEmbeddings
Loading

File-Level Changes

Change Details Files
将 MiniMax 作为一等模型提供者启用,并通过现有的兼容 OpenAI 的 LLM 和 Embedding 路径进行路由。
  • 扩展 ModelProvider 枚举以包含 minimax provider key。
  • 更新 get_model_params,使其识别 MiniMax 为兼容提供者。
  • 更新 get_provider_llm_class,当选择 MiniMax 时返回 CompatibleChatOpenAI。
  • 更新 get_provider_embedding_class,当选择 MiniMax 时使用 OpenAIEmbeddings。
api/app/models/models_model.py
api/app/core/models/base.py
允许在使用现有提供者白名单的多模态工作流中使用 MiniMax。
  • 将 MiniMax 添加到 _MULTIMODAL_COMPATIBLE_PROVIDERS frozenset,以便工作流节点可以将其视为具备多模态能力。
api/app/core/workflow/nodes/llm/config.py
引入包含能力元数据的 MiniMax 专用 catalog 条目,用于两个新模型。
  • 创建 minimax_models.yaml catalog 文件,并限定在 minimax 提供者范围内。
  • 定义具有多模态能力(视觉、视频、思考)和长上下文的 MiniMax-M3。
  • 定义具有扩展上下文并仅包含思考能力标签的 MiniMax-M2.7。
api/app/core/models/scripts/minimax_models.yaml

Tips and commands

Interacting with Sourcery

  • 触发一次新的审查: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 通过回复审查评论要求 Sourcery 从该评论创建一个 issue。你也可以在审查评论中回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题的任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 Pull Request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 正文任意位置写上 @sourcery-ai summary,即可在你指定的位置随时生成 PR 摘要。你也可以在 Pull Request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审查者指南: 在 Pull Request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会非常有用。
  • 忽略所有 Sourcery 审查: 在 Pull Request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。特别适用于你希望以一次全新的审查开始 —— 别忘了再评论 @sourcery-ai review 来触发新的审查!

Customizing Your Experience

访问你的 dashboard 以:

  • 启用或禁用审查功能,例如 Sourcery 生成的 Pull Request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

Getting Help

Original review guide in English

Reviewer's Guide

Adds MiniMax as a supported provider across the model provider enum, OpenAI-compatible routing for LLMs and embeddings, multimodal workflow allowlist, and introduces a dedicated MiniMax catalog YAML with two models and capabilities metadata.

Sequence diagram for MiniMax routing through OpenAI-compatible paths

sequenceDiagram
  actor User
  participant BaseModels as get_provider_llm_class
  participant EmbeddingsFactory as get_provider_embedding_class

  User->>BaseModels: get_provider_llm_class(ModelProvider.MINIMAX)
  BaseModels-->>User: CompatibleChatOpenAI

  User->>EmbeddingsFactory: get_provider_embedding_class(ModelProvider.MINIMAX)
  EmbeddingsFactory-->>User: OpenAIEmbeddings
Loading

File-Level Changes

Change Details Files
Enable MiniMax as a first-class model provider and route it through existing OpenAI-compatible LLM and embedding paths.
  • Extend ModelProvider enum to include the minimax provider key.
  • Update get_model_params to recognize MiniMax as a compatible provider.
  • Update get_provider_llm_class to return CompatibleChatOpenAI when MiniMax is selected.
  • Update get_provider_embedding_class to use OpenAIEmbeddings when MiniMax is selected.
api/app/models/models_model.py
api/app/core/models/base.py
Allow MiniMax for multimodal workflows using the existing provider allowlist.
  • Add MiniMax to the _MULTIMODAL_COMPATIBLE_PROVIDERS frozenset so workflow nodes can treat it as multimodal-capable.
api/app/core/workflow/nodes/llm/config.py
Introduce MiniMax-specific catalog entries with capabilities metadata for two new models.
  • Create minimax_models.yaml catalog file scoped to the minimax provider.
  • Define MiniMax-M3 with multimodal capabilities (vision, video, thinking) and long context.
  • Define MiniMax-M2.7 with extended context and thinking-only capability tags.
api/app/core/models/scripts/minimax_models.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • minimax_models.yaml 中,建议尽量复用现有的能力键(例如 thinking),而不是引入 thinking_only,除非能力的 schema 和下游逻辑已经明确支持这个新值。
  • 请确认通过 CompatibleChatOpenAIOpenAIEmbeddings 来路由 MiniMax 时,是否与 MiniMax API 的语义(请求/响应字段、认证、速率限制)保持一致;如果存在任何差异,建议为 MiniMax 引入一个专门的、与提供方绑定的类。
  • 由于 MiniMax 已被加入到支持多模态的 provider allowlist 中,请确保该 provider 下的非多模态模型(比如 MiniMax-M2.7)要么能通过能力进行过滤,要么能在工作流 UI/校验中得到合理的处理。
面向 AI 智能体的提示词
Please address the comments from this code review:

## Overall Comments
- In `minimax_models.yaml`, consider reusing existing capability keys (e.g., `thinking`) instead of introducing `thinking_only` unless the capability schema and downstream logic already explicitly support this new value.
- Confirm that routing MiniMax through `CompatibleChatOpenAI` and `OpenAIEmbeddings` matches the MiniMax API semantics (request/response fields, auth, rate limits), or introduce a dedicated provider-specific class if any divergences exist.
- Since MiniMax is added to the multimodal-compatible provider allowlist, ensure that non-multimodal models under this provider (like MiniMax-M2.7) are either filtered by capability or handled gracefully by the workflow UI/validation.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • In minimax_models.yaml, consider reusing existing capability keys (e.g., thinking) instead of introducing thinking_only unless the capability schema and downstream logic already explicitly support this new value.
  • Confirm that routing MiniMax through CompatibleChatOpenAI and OpenAIEmbeddings matches the MiniMax API semantics (request/response fields, auth, rate limits), or introduce a dedicated provider-specific class if any divergences exist.
  • Since MiniMax is added to the multimodal-compatible provider allowlist, ensure that non-multimodal models under this provider (like MiniMax-M2.7) are either filtered by capability or handled gracefully by the workflow UI/validation.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `minimax_models.yaml`, consider reusing existing capability keys (e.g., `thinking`) instead of introducing `thinking_only` unless the capability schema and downstream logic already explicitly support this new value.
- Confirm that routing MiniMax through `CompatibleChatOpenAI` and `OpenAIEmbeddings` matches the MiniMax API semantics (request/response fields, auth, rate limits), or introduce a dedicated provider-specific class if any divergences exist.
- Since MiniMax is added to the multimodal-compatible provider allowlist, ensure that non-multimodal models under this provider (like MiniMax-M2.7) are either filtered by capability or handled gracefully by the workflow UI/validation.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@octo-patch

Copy link
Copy Markdown
Author

Updated the PR to keep MiniMax support scoped to the documented text models: MiniMax is no longer exposed as an embedding provider, and multimodal input now follows each model's declared capabilities so MiniMax-M2.7 remains text-only. I ran Python compile checks, focused catalog/source assertions, and git diff --check.

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