Documentation
¶
Overview ¶
Package inworld provides Inworld text-to-speech (and LLM).
Index ¶
Constants ¶
View Source
const DefaultLLMModel = "gpt-4o-mini"
Variables ¶
This section is empty.
Functions ¶
func NewLLMClient ¶
NewLLMClient returns an OpenAI-compatible client for Inworld router API.
Types ¶
type LLMService ¶
type LLMService struct {
// contains filtered or unexported fields
}
LLMService implements services.LLMService using Inworld's router chat completions API.
func NewLLMService ¶
func NewLLMService(apiKey, model string) *LLMService
NewLLMService creates an Inworld LLM service.
func (*LLMService) Chat ¶
func (s *LLMService) Chat(ctx context.Context, messages []map[string]any, onToken func(*frames.LLMTextFrame)) error
Chat runs a completion and streams tokens as LLMTextFrame.
type TTSService ¶
type TTSService struct {
// contains filtered or unexported fields
}
TTSService implements services.TTSService using Inworld TTS API.
func NewTTS ¶
func NewTTS(apiKey, voiceID string) *TTSService
NewTTS creates an Inworld TTS service.
func (*TTSService) Speak ¶
func (s *TTSService) Speak(ctx context.Context, text string, sampleRate int) ([]*frames.TTSAudioRawFrame, error)
Speak synthesizes text and returns TTS audio frames.
Click to show internal directories.
Click to hide internal directories.