minimax

package module
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package minimax exposes MiniMax chat adapters. NewChat targets its OpenAI-compatible endpoint; NewMessages targets its Anthropic-compatible endpoint.

Index

Constants

View Source
const (
	OpenAIRequestExtensionKey        = "minimax/openai_request"
	OpenAIResponseExtensionKey       = "minimax/openai_response"
	OpenAIStreamChunkExtensionKey    = "minimax/openai_stream_chunk"
	AnthropicRequestExtensionKey     = "minimax/anthropic_request"
	AnthropicResponseExtensionKey    = "minimax/anthropic_response"
	AnthropicStreamEventExtensionKey = "minimax/anthropic_stream_event"
)
View Source
const (
	// BaseURLIntl is the international OpenAI-compat endpoint.
	BaseURLIntl = "https://api.minimax.io/v1"

	// BaseURLChina is the China OpenAI-compat endpoint.
	BaseURLChina = "https://api.minimaxi.com/v1"
)

OpenAI-compatible endpoints.

View Source
const (
	// BaseURLIntlAnthropic is the international Anthropic-compat endpoint.
	BaseURLIntlAnthropic = "https://api.minimax.io/anthropic"

	// BaseURLChinaAnthropic is the China Anthropic-compat endpoint.
	BaseURLChinaAnthropic = "https://api.minimaxi.com/anthropic"
)

Anthropic-compatible endpoints. The anthropic-sdk-go client appends "v1/messages" to the supplied BaseURL so the full request URL ends at, e.g., https://api.minimax.io/anthropic/v1/messages.

View Source
const (
	ModelM3           = "MiniMax-M3"
	ModelM27          = "MiniMax-M2.7"
	ModelM27HighSpeed = "MiniMax-M2.7-highspeed"
	ModelM25          = "MiniMax-M2.5"
	ModelM25HighSpeed = "MiniMax-M2.5-highspeed"
	ModelM21          = "MiniMax-M2.1"
	ModelM21HighSpeed = "MiniMax-M2.1-highspeed"
	ModelM2           = "MiniMax-M2"
)

Current Chat model ids. See https://platform.minimaxi.com/docs/guides/models-intro.

View Source
const (
	Provider = "MiniMax"
)
View Source
const (
	// RequestExtensionKey stores MiniMax-specific Chat Completions options in a
	// Core request.
	RequestExtensionKey = "minimax/request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat added in v0.13.0

type Chat = openai.ChatCompletions

Chat implements MiniMax's OpenAI-compatible endpoint.

func NewChat added in v0.13.0

func NewChat(config ChatConfig) (*Chat, error)

type ChatConfig added in v0.13.0

type ChatConfig struct {
	APIKey         string
	DefaultOptions corechat.Options
	BaseURL        string
	HTTPClient     *http.Client
}

func (ChatConfig) Validate added in v0.13.0

func (c ChatConfig) Validate() error

type ChatRequestOptions

type ChatRequestOptions struct {
	Thinking       ThinkingType `json:"thinking,omitempty"`
	ReasoningSplit *bool        `json:"reasoning_split,omitempty"`
	ServiceTier    ServiceTier  `json:"service_tier,omitempty"`
}

ChatRequestOptions contains MiniMax request fields without a provider-neutral Core equivalent.

func (ChatRequestOptions) Validate

func (c ChatRequestOptions) Validate() error

type Messages added in v0.13.0

type Messages = anthropic.Messages

Messages implements MiniMax's Anthropic-compatible endpoint.

func NewMessages added in v0.13.0

func NewMessages(config MessagesConfig) (*Messages, error)

type MessagesConfig added in v0.13.0

type MessagesConfig struct {
	APIKey         string
	DefaultOptions corechat.Options
	BaseURL        string
	HTTPClient     *http.Client
}

func (MessagesConfig) Validate added in v0.13.0

func (m MessagesConfig) Validate() error

type ServiceTier

type ServiceTier string

ServiceTier controls MiniMax request admission priority.

const (
	ServiceTierStandard ServiceTier = "standard"
	ServiceTierPriority ServiceTier = "priority"
)

type ThinkingType

type ThinkingType string

ThinkingType controls MiniMax-M3 thinking. M2.x models ignore disabled and always think according to the official protocol.

const (
	ThinkingAdaptive ThinkingType = "adaptive"
	ThinkingDisabled ThinkingType = "disabled"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL