Documentation
¶
Overview ¶
Package mock provides mock STT, LLM, and TTS services for testing and stress testing without calling real APIs. All mocks are configurable (response text, audio length, optional latency).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLM ¶
type LLM struct {
// Response is the text streamed via onToken (one rune per call).
Response string
// Latency is the optional delay before starting (for latency simulation).
Latency time.Duration
}
LLM is a mock LLM service that streams a configurable response.
func NewLLMWithResponse ¶
NewLLMWithResponse returns a mock LLM that streams the given response.
type STT ¶
type STT struct {
// Transcript is the text returned for every Transcribe call.
Transcript string
// Transcripts is used for round-robin when set (non-empty); overrides Transcript.
Transcripts []string
// Latency is the optional delay before returning (for latency simulation).
Latency time.Duration
// contains filtered or unexported fields
}
STT is a mock STT service that returns configurable transcription(s).
func NewSTTWithTranscript ¶
NewSTTWithTranscript returns a mock STT that always returns the given transcript.
func (*STT) Transcribe ¶
func (m *STT) Transcribe(ctx context.Context, audio []byte, sampleRate, numChannels int) ([]*frames.TranscriptionFrame, error)
Transcribe returns one or more TranscriptionFrame with the configured text.
type TTS ¶
type TTS struct {
// AudioBytes is the number of bytes of audio to return per Speak call (default 2400 = 50ms at 24kHz mono 16-bit).
AudioBytes int
// SampleRate is the sample rate of the returned audio (default 24000).
SampleRate int
// Latency is the optional delay before returning (for latency simulation).
Latency time.Duration
}
TTS is a mock TTS service that returns configurable audio (e.g. silence).
Click to show internal directories.
Click to hide internal directories.