Documentation
¶
Overview ¶
Package run holds the shared scaffolding for the per-provider voice examples under examples/voice. Each example wires one provider stack explicitly in Go and calls Voice; this package owns the WebRTC transport, the STT -> LLM -> TTS pipeline, turn-taking and barge-in, and the HTTP server.
jargo itself reads no environment variables: the library takes explicit Config structs. The examples follow the same rule — the provider and its settings are written out in Go; only the API key secret is read from the environment, the way you would source any secret.
Index ¶
- Constants
- func Build[C interface{ ... }, S processor.Processor](cfg C, ctor func(C) S) (processor.Processor, error)
- func DefaultLLM() (processor.Processor, error)
- func DefaultSTT() (processor.Processor, error)
- func DefaultTTS() (processor.Processor, error)
- func Voice(b Builders) error
- type Builder
- type Builders
Constants ¶
const SampleRate = opus.SampleRate
SampleRate is the audio sample rate the examples run at (Opus full-band).
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build[C interface{ Validate() error }, S processor.Processor](cfg C, ctor func(C) S) (processor.Processor, error)
Build validates cfg and, when valid, constructs the service with ctor. It keeps each provider's builder to a single line and makes a misconfigured provider fail fast with a clear error rather than at the first request.
func DefaultLLM ¶
DefaultLLM builds the default LLM service (Anthropic), reading ANTHROPIC_API_KEY.
func DefaultSTT ¶
DefaultSTT builds the default STT service (Deepgram), reading DEEPGRAM_API_KEY.
func DefaultTTS ¶
DefaultTTS builds the default TTS service (ElevenLabs), reading ELEVENLABS_API_KEY.
Types ¶
type Builder ¶
Builder constructs one service. It is called once per connection so each caller gets a fresh STT/LLM/TTS — the STT and TTS services hold a per-session stream and must not be shared between connections.