feat(model): add MiniMax OpenAI-compatible provider - #2299
Conversation
a65d483 to
db7ab23
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds MiniMax as an OpenAI-compatible provider with two well-designed formatters (MiniMaxFormatter for single-agent, MiniMaxMultiAgentFormatter for multi-agent) and a ModelProvider SPI implementation. The formatters correctly override applyOptions (for reasoning_split), applyMaxTokens (for MiniMax's max_tokens deprecation), and supportsStrict. The MiniMaxModelProvider follows the established OpenAIModelProvider pattern with proper ModelCreationContext integration and advanced option support. Test coverage is comprehensive — unit tests for both formatters and the provider, plus an E2E smoke test gated by MINIMAX_API_KEY. No logic bugs, concurrency issues, or architectural violations were found.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds MiniMax as an OpenAI-compatible provider with two well-designed formatters (MiniMaxFormatter for single-agent, MiniMaxMultiAgentFormatter for multi-agent) and a ModelProvider SPI implementation. The formatters correctly override applyOptions (for reasoning_split), applyMaxTokens (for MiniMax's max_tokens deprecation), and supportsStrict. The MiniMaxModelProvider follows the established OpenAIModelProvider pattern with proper ModelCreationContext integration and advanced option support. Test coverage is comprehensive — unit tests for both formatters and the provider, plus an E2E smoke test gated by MINIMAX_API_KEY. No logic bugs, concurrency issues, or architectural violations were found.
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
This PR contains 867 lines of changes. Review in progress.
Automated review by github-manager-bot
What does this PR do?
Closes #2214.
This PR adds MiniMax support to the OpenAI-compatible model extension.
minimax:ModelProviderthrough Java SPI.https://api.minimaxi.com/v1.ModelCreationContext.apiKeyorMINIMAX_API_KEY.max_tokensusage tomax_completion_tokens.reasoning_splitby default so MiniMax reasoning fields can be parsed asThinkingBlock.Why?
MiniMax provides an OpenAI-compatible Chat Completions endpoint:
https://platform.minimaxi.com/docs/api-reference/text-chat-openai
The MiniMax formatter keeps provider-specific behavior small and explicit.
reasoning_splitis enabled before the base formatter applies options so users can still override it withGenerateOptions.additionalBodyParam.nativeStructuredOutputis disabled by default because local real-API probing showed that MiniMax accepts OpenAI-compatible requests, butresponse_format=json_schema strict=truedoes not behave as a reliable native structured-output contract across MiniMax-M3 and M2.x models. Users can still opt in throughModelCreationContext.option("nativeStructuredOutput", true)for experimentation.Tests
mvn -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-openai testAdditional local real-API smoke/probe coverage was run against: