Skip to content

feat: add MiniMax as first-class LLM provider#6

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

feat: add MiniMax as first-class LLM provider#6
octo-patch wants to merge 1 commit intoAgentfy-io:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

This PR adds MiniMax as a first-class AI provider in Agentfy, following the same pattern as the existing ChatGPT and Claude wrappers.

Changes

  • common/ais/minimax.pyMiniMax async client wrapping the OpenAI-compatible API (https://api.minimax.io/v1). Supports M2.7, M2.7-highspeed, M2.5, M2.5-highspeed (all 204K context). Includes temperature clamping to (0.0, 1.0] as required by the API, model cost tracking, and model-name normalisation.
  • common/ais/__init__.py — exports the new MiniMax class alongside ChatGPT and Claude.
  • common/exceptions/exceptions.py — adds MiniMaxAPIError following the existing exception hierarchy.
  • config.py — adds minimax_api_key field reading from MINIMAX_API_KEY environment variable.
  • tests/test_minimax_unit.py — 22 unit tests covering init, temperature clamping, model normalisation, cost calculation, and error handling (no network required).
  • tests/test_minimax_integration.py — 3 integration tests (auto-skipped when MINIMAX_API_KEY is not set).
  • tests/conftest.py — pytest path setup.

Usage

from common.ais.minimax import MiniMax

mm = MiniMax()  # reads MINIMAX_API_KEY from env
result = await mm.chat(
    system_prompt="You are a helpful assistant.",
    user_prompt="Summarise the latest social media trends.",
    model="MiniMax-M2.7",      # 204K context
)

MiniMax offers competitive pricing and a large 204K context window, making it an excellent addition to Agentfy's multi-provider AI toolkit.

Add MiniMax AI support via OpenAI-compatible API (https://api.minimax.io/v1).

Changes:
- common/ais/minimax.py: MiniMax async client wrapper with M2.7/M2.5 model
  support, temperature clamping (0.0, 1.0], and cost tracking
- common/ais/__init__.py: export MiniMax class
- common/exceptions/exceptions.py: add MiniMaxAPIError
- config.py: add minimax_api_key (MINIMAX_API_KEY env var)
- tests/test_minimax_unit.py: 22 unit tests (init, temp clamping, model
  normalization, cost calc, chat error handling)
- tests/test_minimax_integration.py: 3 integration tests (skipped without key)
- tests/conftest.py: pytest sys.path setup
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