Skip to content

feat(minimax): add reasoning_split support for MiniMax M2 models#1459

Closed
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:fix/minimax-endpoint
Closed

feat(minimax): add reasoning_split support for MiniMax M2 models#1459
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:fix/minimax-endpoint

Conversation

@darrenzeng2025
Copy link
Copy Markdown
Contributor

Summary

This PR adds support for MiniMax's reasoning_split parameter to properly separate thinking content (cot) from response text when using MiniMax M2 models.

Problem

Issue #1320 reported that:

  1. MiniMax official endpoint v1/text/chatcompletion_v2 is not supported
  2. When using v1/chat/completions endpoint, thinking content (cot) appears in the text
  3. Need to use reasoning_split:true to move cot to reasoning_details field

Solution

Added reasoning_split parameter support for MiniMax provider:

  1. ModelConfig (pkg/config/config.go):

    • Added ReasoningSplit bool field for provider-specific options
  2. openai_compat provider (pkg/providers/openai_compat/provider.go):

    • Added reasoningSplit field to Provider struct
    • Added WithReasoningSplit() option function
    • When enabled, adds reasoning_split: true to request body
  3. HTTP Provider (pkg/providers/http_provider.go):

    • Added NewHTTPProviderWithOptions() constructor
    • Supports reasoningSplit parameter
  4. Factory Provider (pkg/providers/factory_provider.go):

    • Separated MiniMax case to use NewHTTPProviderWithOptions()
    • Passes cfg.ReasoningSplit to provider
  5. Migration (pkg/config/migration.go):

    • Added MiniMax to provider migration config

Usage

{
  "model_list": [
    {
      "model_name": "minimax-m2",
      "model": "minimax/MiniMax-M2.5",
      "api_key": "your-api-key",
      "reasoning_split": true
    }
  ]
}

When reasoning_split is enabled, MiniMax M2 models will return reasoning content in the reasoning_details field instead of embedding it within <think> tags in the content field.

Testing

  • Code formatting verified with gofmt
  • No syntax errors

Fixes #1320

@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: provider domain: config go Pull requests that update go code dependencies Pull requests that update a dependency file labels Mar 13, 2026
Add support for MiniMax's reasoning_split parameter to properly separate
thinking content (cot) from response text.

Changes:
- Add ReasoningSplit field to ModelConfig
- Add WithReasoningSplit option to openai_compat provider
- Add NewHTTPProviderWithOptions to support reasoning_split parameter
- Update factory_provider to pass reasoning_split for MiniMax
- Add MiniMax to provider migration config

When reasoning_split is enabled, MiniMax M2 models will return reasoning
content in the reasoning_details field instead of embedding it within
<thinking> tags in the content field.

Fixes sipeed#1320

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sipeed-bot
Copy link
Copy Markdown

sipeed-bot bot commented Mar 28, 2026

@darrenzeng2025 Hi! This PR has had no activity for over 2 weeks, so I'm closing it for now to keep things tidy. If it's still relevant, feel free to reopen it anytime and we'll pick it back up.

@sipeed-bot sipeed-bot bot closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file domain: config domain: provider go Pull requests that update go code type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] MiniMax official endpoint not supportted!

1 participant