Merge pull request #221 from octo-patch/feature/add-minimax-provider

feat: add MiniMax model support with temperature clamping
This commit is contained in:
Simon
2026-03-17 14:16:59 +08:00
committed by GitHub
2 changed files with 17 additions and 0 deletions

View File

@@ -93,6 +93,15 @@ export function modelPatch(body: Record<string, any>) {
body.reasoning_effort = 'minimal' body.reasoning_effort = 'minimal'
} }
if (modelName.startsWith('minimax')) {
debug('Applying MiniMax patch: clamp temperature to (0, 1]')
// MiniMax API rejects temperature = 0; clamp to a small positive value
body.temperature = Math.max(body.temperature || 0, 0.01)
if (body.temperature > 1) body.temperature = 1
// MiniMax does not support parallel_tool_calls
delete body.parallel_tool_calls
}
return body return body
} }

View File

@@ -34,6 +34,7 @@ const MODEL_GROUPS: Record<string, string[]> = {
'claude-sonnet-3.5', 'claude-sonnet-3.5',
], ],
xAI: ['grok-4.1-fast', 'grok-4', 'grok-code-fast'], xAI: ['grok-4.1-fast', 'grok-4', 'grok-code-fast'],
MiniMax: ['MiniMax-M2.5', 'MiniMax-M2.5-highspeed'],
MoonshotAI: ['kimi-k2.5'], MoonshotAI: ['kimi-k2.5'],
'Z.AI': ['glm-5', 'glm-4.7'], 'Z.AI': ['glm-5', 'glm-4.7'],
} }
@@ -121,6 +122,13 @@ const pageAgent = new PageAgent({
model: 'qwen3.5-plus' model: 'qwen3.5-plus'
}); });
// MiniMax
const pageAgent = new PageAgent({
baseURL: 'https://api.minimax.io/v1',
apiKey: 'your-minimax-api-key',
model: 'MiniMax-M2.5'
});
// Self-hosted models (e.g., Ollama) // Self-hosted models (e.g., Ollama)
const pageAgent = new PageAgent({ const pageAgent = new PageAgent({
baseURL: 'http://localhost:11434/v1', baseURL: 'http://localhost:11434/v1',