inference

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccessToken

func CreateAccessToken(apiKey, apiSecret string, ttl time.Duration) (string, error)

Types

type FallbackModel

type FallbackModel struct {
	Model       string         `json:"model"`
	Voice       string         `json:"voice"`
	ExtraKwargs map[string]any `json:"extra,omitempty"`
}

type LLM

type LLM struct {
	// contains filtered or unexported fields
}

func NewLLM

func NewLLM(model string, apiKey, apiSecret string) *LLM

func (*LLM) Chat

func (l *LLM) Chat(ctx context.Context, chatCtx *llm.ChatContext, opts ...llm.ChatOption) (llm.LLMStream, error)

type STT

type STT struct {
	// contains filtered or unexported fields
}

func NewSTT

func NewSTT(model string, apiKey, apiSecret string) *STT

func (*STT) Capabilities

func (s *STT) Capabilities() stt.STTCapabilities

func (*STT) Label

func (s *STT) Label() string

func (*STT) Recognize

func (s *STT) Recognize(ctx context.Context, frames []*model.AudioFrame, language string) (*stt.SpeechEvent, error)

func (*STT) Stream

func (s *STT) Stream(ctx context.Context, language string) (stt.RecognizeStream, error)

type TTS

type TTS struct {
	// contains filtered or unexported fields
}

func NewTTS

func NewTTS(model string, apiKey, apiSecret string) *TTS

func (*TTS) Capabilities

func (t *TTS) Capabilities() tts.TTSCapabilities

func (*TTS) Label

func (t *TTS) Label() string

func (*TTS) NumChannels

func (t *TTS) NumChannels() int

func (*TTS) SampleRate

func (t *TTS) SampleRate() int

func (*TTS) Stream

func (t *TTS) Stream(ctx context.Context) (tts.SynthesizeStream, error)

func (*TTS) Synthesize

func (t *TTS) Synthesize(ctx context.Context, text string) (tts.ChunkedStream, error)

Jump to

Keyboard shortcuts

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