inference

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InferenceAccessTokenTTL = 10 * time.Minute

	HeaderUserAgent         = "User-Agent"
	HeaderRoomID            = "X-LiveKit-Room-ID"
	HeaderJobID             = "X-LiveKit-Job-ID"
	HeaderInferenceProvider = "X-LiveKit-Inference-Provider"
	HeaderInferencePriority = "X-LiveKit-Inference-Priority"
)

Variables

This section is empty.

Functions

func AddContextHeaders added in v0.0.15

func AddContextHeaders(headers http.Header)

func CreateAccessToken

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

func InferenceHeaders added in v0.0.15

func InferenceHeaders() http.Header

func SetContextHeadersProvider added in v0.0.15

func SetContextHeadersProvider(provider func() map[string]string) func()

Types

type APIConnectOptions added in v0.0.15

type APIConnectOptions = llm.APIConnectOptions

type FallbackModel

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

type STT

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

func NewSTT

func NewSTT(model string, apiKey, apiSecret string, opts ...STTOption) *STT

func (*STT) Capabilities

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

func (*STT) Label

func (s *STT) Label() string

func (*STT) Model added in v0.0.15

func (s *STT) Model() string

func (*STT) Provider added in v0.0.15

func (s *STT) Provider() 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)

func (*STT) UpdateOptions added in v0.0.15

func (s *STT) UpdateOptions(opts ...STTOption)

type STTOption added in v0.0.15

type STTOption func(*STT)

func WithSTTConnectOptions added in v0.0.15

func WithSTTConnectOptions(options APIConnectOptions) STTOption

func WithSTTEncoding added in v0.0.15

func WithSTTEncoding(encoding string) STTOption

func WithSTTExtraKwargs added in v0.0.15

func WithSTTExtraKwargs(extra map[string]any) STTOption

func WithSTTFallbackModels added in v0.0.15

func WithSTTFallbackModels(models ...FallbackModel) STTOption

func WithSTTLanguage added in v0.0.15

func WithSTTLanguage(language string) STTOption

func WithSTTModel added in v0.0.15

func WithSTTModel(model string) STTOption

func WithSTTSampleRate added in v0.0.15

func WithSTTSampleRate(sampleRate int) STTOption

type TTS

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

func NewTTS

func NewTTS(model string, apiKey, apiSecret string, opts ...TTSOption) *TTS

func (*TTS) Capabilities

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

func (*TTS) Label

func (t *TTS) Label() string

func (*TTS) Model added in v0.0.15

func (t *TTS) Model() string

func (*TTS) NumChannels

func (t *TTS) NumChannels() int

func (*TTS) Prewarm added in v0.0.15

func (t *TTS) Prewarm()

func (*TTS) Provider added in v0.0.15

func (t *TTS) Provider() string

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)

func (*TTS) UpdateOptions added in v0.0.15

func (t *TTS) UpdateOptions(opts ...TTSOption)

type TTSOption added in v0.0.15

type TTSOption func(*TTS)

func WithSentenceTokenizer added in v0.0.15

func WithSentenceTokenizer(tokenizer tokenize.SentenceTokenizer) TTSOption

func WithTTSConnectOptions added in v0.0.15

func WithTTSConnectOptions(options APIConnectOptions) TTSOption

func WithTTSEncoding added in v0.0.15

func WithTTSEncoding(encoding string) TTSOption

func WithTTSExtraKwargs added in v0.0.15

func WithTTSExtraKwargs(extra map[string]any) TTSOption

func WithTTSFallbackModels added in v0.0.15

func WithTTSFallbackModels(models ...FallbackModel) TTSOption

func WithTTSLanguage added in v0.0.15

func WithTTSLanguage(language string) TTSOption

func WithTTSModel added in v0.0.15

func WithTTSModel(model string) TTSOption

func WithTTSSampleRate added in v0.0.15

func WithTTSSampleRate(sampleRate int) TTSOption

func WithTTSVoice added in v0.0.15

func WithTTSVoice(voice string) TTSOption

Jump to

Keyboard shortcuts

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