xiaomi

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 xiaomi exposes Xiaomi MiMo chat adapters. NewChat targets its OpenAI-compatible endpoint; NewMessages targets its Anthropic-compatible endpoint.

Index

Constants

View Source
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"
)
View Source
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.

View Source
const (
	// BaseURL is the MiMo OpenAI-compatible endpoint.
	BaseURL = "https://api.xiaomimimo.com/v1"
)

OpenAI-compatible endpoint.

View Source
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.

View Source
const (
	Provider = "Xiaomi"
)
View Source
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

type Messages = anthropic.Messages

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"
)

Jump to

Keyboard shortcuts

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