feat(minimax): enable tool calling on M2.7 models#2180
Conversation
WalkthroughThe PR enables the ChangesMiniMax Tools Capability
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/models/src/models/minimax.ts`:
- Line 24: The together-ai provider entries for the minimax models have tools
disabled while the native minimax provider enables them; update the together-ai
provider configs for both model keys "minimax-m2.7" and "minimax-m2.7-highspeed"
to set tools: true (i.e., find the together-ai provider blocks for these model
definitions in the minimax provider config and change their tools property from
false to true so tool calling is consistently enabled).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6f925e2c-11d7-4446-826d-3b0fe18c03d5
📒 Files selected for processing (1)
packages/models/src/models/minimax.ts
| splitTaggedReasoning: true, | ||
| vision: false, | ||
| tools: false, | ||
| tools: true, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check MiniMax documentation and test files for tool calling support on M2.7
# Search for any tests or documentation mentioning M2.7 tool calling
rg -n -C3 -i 'minimax.*m2\.7.*tool|tool.*minimax.*m2\.7' --type ts --type md
# Search for test files that might validate tool calling
fd -e test.ts -e spec.ts -x rg -l 'minimax.*m2\.7|MiniMax-M2\.7' {}
# Look for integration tests or provider implementations that might show tool support
rg -n -C3 'MiniMax-M2\.7.*tool|providerId.*minimax.*tool' --type tsRepository: theopenco/llmgateway
Length of output: 46
🌐 Web query:
Does MiniMax API support tool calling for M2.7 and M2.7-highspeed models?
💡 Result:
Yes. MiniMax API supports tool calling for both the MiniMax-M2.7 and MiniMax-M2.7-highspeed models. Evidence: MiniMax’s “Tool Use & Interleaved Thinking” documentation describes tool calling with MiniMax-M2.7, including a tools field in the request and a tool_calls field in responses [1]. The MiniMax API model lineup lists both “MiniMax-M2.7-highspeed” (same performance as M2.7, faster inference) and includes that it is a supported text generation model in the API [2]. MiniMax’s API overview states the text generation API can “trigger tool calls” and lists MiniMax-M2.7-highspeed among the supported models [3]. Additionally, the MiniMax-M2.7 documentation explicitly states that M2.7 has exceptional tool use capabilities [1] and the corresponding M2.7 tool-calling guide in the model’s repository describes tool calling for MiniMax-M2.7 (tool calls defined via the request tools field and structured output) [4]. So, for tool calling, you can use the tools field and process the returned tool_calls for either model name: MiniMax-M2.7 or MiniMax-M2.7-highspeed [3][1][4].
Citations:
- 1: https://platform.minimax.io/docs/guides/text-m2-function-call
- 2: https://platform.minimax.io/docs/guides/models-intro
- 3: https://platform.minimax.io/docs/api-reference/api-overview
- 4: https://github.com/MiniMax-AI/MiniMax-M2.7/blob/main/docs/tool_calling_guide.md
🏁 Script executed:
cat -n packages/models/src/models/minimax.ts | head -60Repository: theopenco/llmgateway
Length of output: 1829
🏁 Script executed:
# Search for together-ai provider capabilities in the codebase
rg -n -C5 'together-ai' packages/models/src/models/ --type tsRepository: theopenco/llmgateway
Length of output: 8728
🌐 Web query:
Does Together AI support tool calling for MiniMax M2.7 models?
💡 Result:
Yes. Together AI supports tool calling for the MiniMax M2.7 model (MiniMaxAI/MiniMax-M2.7). Evidence: - Together’s MiniMax M2.7 model page documents how to call the model via the chat/completions endpoint and identifies the model name as MiniMaxAI/MiniMax-M2.7 on Together AI.[1] - MiniMax’s own M2.7 documentation states that “MiniMax-M2.7 supports … tool calling capabilities,” instructing how to include a tools field in the request and how tool calls are represented in the model’s structured output (XML-tag format).[2] So, when using Together AI’s API with model=MiniMaxAI/MiniMax-M2.7, you can provide a tools field and the model will produce tool-call outputs according to MiniMax’s tool-calling format.[2][1]
Citations:
- 1: https://www.together.ai/models/minimax-m2-7
- 2: https://github.com/MiniMax-AI/MiniMax-M2.7/blob/main/docs/tool_calling_guide.md
Update together-ai provider for both minimax-m2.7 and minimax-m2.7-highspeed models to enable tool calling.
The MiniMax API supports tool calling for M2.7 and M2.7-highspeed models, so enabling tools: true for the native minimax provider is correct. However, Together AI also supports tool calling for these models, but the together-ai provider configs have tools: false. This creates inconsistent feature availability across providers for the same model.
Update:
- minimax-m2.7 together-ai provider (line 54): change
tools: falsetotools: true - minimax-m2.7-highspeed together-ai provider: change
tools: falsetotools: true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/models/src/models/minimax.ts` at line 24, The together-ai provider
entries for the minimax models have tools disabled while the native minimax
provider enables them; update the together-ai provider configs for both model
keys "minimax-m2.7" and "minimax-m2.7-highspeed" to set tools: true (i.e., find
the together-ai provider blocks for these model definitions in the minimax
provider config and change their tools property from false to true so tool
calling is consistently enabled).
Summary by CodeRabbit