Documentation
¶
Overview ¶
Package xiaomi provides Xiaomi MiMo API integration for the LLM gateway.
Index ¶
- Variables
- func New(cfg providers.ProviderConfig, opts providers.ProviderOptions) core.Provider
- type Provider
- func (p *Provider) CreateSpeech(ctx context.Context, req *core.AudioSpeechRequest) (*core.AudioResponse, error)
- func (p *Provider) CreateTranscription(ctx context.Context, req *core.AudioTranscriptionRequest) (*core.AudioResponse, error)
- func (p *Provider) Embeddings(_ context.Context, _ *core.EmbeddingRequest) (*core.EmbeddingResponse, error)
Constants ¶
This section is empty.
Variables ¶
var Registration = providers.Registration{ Type: "xiaomi", New: New, Discovery: providers.DiscoveryConfig{ DefaultBaseURL: defaultBaseURL, }, }
Registration provides factory registration for the Xiaomi MiMo provider.
Functions ¶
func New ¶
func New(cfg providers.ProviderConfig, opts providers.ProviderOptions) core.Provider
New creates a new Xiaomi MiMo provider.
Types ¶
type Provider ¶
type Provider struct {
*openai.ChatCompatible
}
Provider implements the core.Provider interface for Xiaomi MiMo. MiMo-specific extensions such as the "thinking" parameter pass through unchanged as unknown JSON fields.
func (*Provider) CreateSpeech ¶
func (p *Provider) CreateSpeech(ctx context.Context, req *core.AudioSpeechRequest) (*core.AudioResponse, error)
CreateSpeech synthesizes speech by translating the request into a MiMo TTS chat completion: the synthesis text goes in an assistant message, optional style instructions in a user message, and voice/format in the top-level audio parameter. The base64 audio returned in message.audio.data is decoded back into binary.
func (*Provider) CreateTranscription ¶
func (p *Provider) CreateTranscription(ctx context.Context, req *core.AudioTranscriptionRequest) (*core.AudioResponse, error)
CreateTranscription transcribes audio by translating the request into a MiMo ASR chat completion: the audio bytes are sent as a base64 data: URI in an input_audio content part, with the language passed via asr_options.
func (*Provider) Embeddings ¶
func (p *Provider) Embeddings(_ context.Context, _ *core.EmbeddingRequest) (*core.EmbeddingResponse, error)
Embeddings returns an error because Xiaomi MiMo does not expose an embeddings endpoint.