Skip to content

feat(providers): add MiniMax provider (MiniMax-M2.7, M2.5, 204K context) - #15

Open
octo-patch wants to merge 1 commit into
neurocult:mainfrom
octo-patch:feature/add-minimax-provider
Open

feat(providers): add MiniMax provider (MiniMax-M2.7, M2.5, 204K context)#15
octo-patch wants to merge 1 commit into
neurocult:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

This PR adds a providers/minimax package that makes it easy to use MiniMax language models with the Agency library.

MiniMax exposes an OpenAI-compatible REST API (https://api.minimax.io/v1), so the new package is a thin wrapper around the existing providers/openai package.

What changed

File Description
providers/minimax/provider.go New provider: New(), model constants, TextToText(), TextToStream(), temperature clamping
providers/minimax/provider_test.go 10 unit tests (temperature clamping, operation creation, constants)
providers/minimax/provider_integration_test.go 1 live integration test (skipped when MINIMAX_API_KEY is unset)
examples/minimax/main.go Minimal interactive chat loop using MiniMax-M2.7
README.md Mentions the new provider; marks roadmap item as done

Supported models

Constant Model name Context
ModelM27 MiniMax-M2.7 204 K
ModelM27HighSpeed MiniMax-M2.7-highspeed 204 K
ModelM25 MiniMax-M2.5 204 K
ModelM25HighSpeed MiniMax-M2.5-highspeed 204 K

Temperature handling

MiniMax requires temperature to be in the range (0, 1]. The provider automatically clamps any nil/zero/negative value to 0.01 and any value above 1 to 1.0, so callers never need to worry about invalid values.

Usage

import (
    "github.com/neurocult/agency/providers/minimax"
)

assistant := minimax.
    New(minimax.Params{Key: os.Getenv("MINIMAX_API_KEY")}).
    TextToText(minimax.TextToTextParams{Model: minimax.ModelM27}).
    SetPrompt("You are a helpful assistant.")

Tests

ok  github.com/neurocult/agency/providers/minimax  (10 unit + 1 integration tests)

Add providers/minimax package that configures the existing openai
provider to use the MiniMax OpenAI-compatible API endpoint
(https://api.minimax.io/v1).

- Supports MiniMax-M2.7, M2.7-highspeed, M2.5, M2.5-highspeed models
- Temperature auto-clamped to (0, 1] as required by MiniMax API
- 10 unit tests + 1 live integration test
- examples/minimax/main.go: minimal chat loop example
- README updated to highlight the new provider
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