Documentation
¶
Overview ¶
Package xiaomi exposes Xiaomi MiMo chat adapters. NewChat targets its OpenAI-compatible endpoint; NewMessages targets its Anthropic-compatible endpoint.
Index ¶
Constants ¶
const ( OpenAIRequestExtensionKey = "xiaomi/openai_request" OpenAIResponseExtensionKey = "xiaomi/openai_response" OpenAIStreamChunkExtensionKey = "xiaomi/openai_stream_chunk" AnthropicRequestExtensionKey = "xiaomi/anthropic_request" AnthropicResponseExtensionKey = "xiaomi/anthropic_response" AnthropicStreamEventExtensionKey = "xiaomi/anthropic_stream_event" )
const ( ModelV25Pro = "mimo-v2.5-pro" ModelV25 = "mimo-v2.5" )
Current Chat model ids. See https://mimo.mi.com/static/docs/quick-start/summary/model.md.
const (
// BaseURL is the MiMo OpenAI-compatible endpoint.
BaseURL = "https://api.xiaomimimo.com/v1"
)
OpenAI-compatible endpoint.
const (
// BaseURLAnthropic is the MiMo Anthropic-compatible endpoint.
BaseURLAnthropic = "https://api.xiaomimimo.com/anthropic"
)
Anthropic-compatible endpoint. anthropic-sdk-go appends "v1/messages" to the supplied BaseURL so the full URL ends at https://api.xiaomimimo.com/anthropic/v1/messages.
const (
Provider = "Xiaomi"
)
const RequestExtensionKey = "xiaomi/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 MiMo'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"`
}
ChatRequestOptions contains MiMo Chat Completions fields without a provider-neutral Core equivalent.
func (ChatRequestOptions) Validate ¶
func (c ChatRequestOptions) Validate() error
type Messages ¶ added in v0.13.0
Messages implements MiMo'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 ThinkingType ¶
type ThinkingType string
ThinkingType controls MiMo deep thinking.
const ( ThinkingEnabled ThinkingType = "enabled" ThinkingDisabled ThinkingType = "disabled" )