voicemate.events¶
Events flowing from the voice pipeline to the UI, and a small asyncio pub/sub bus.
The UI renders one lane per pipeline stage. Several lanes can be active at the same time (the LLM keeps generating while earlier sentences are synthesized and spoken), so the status model is per lane rather than a single exclusive state.
Attributes¶
Classes¶
Pipeline stage shown as one status lane in the UI. |
|
State of a lane. |
|
A lane changed state. |
|
Recognized user speech (or typed text). |
|
A streamed piece of the assistant reply. |
|
The complete assistant reply of a turn. |
|
A tool call started or finished. |
|
A chunk of synthesized speech for the browser to play. |
|
The user barged in: stop playback immediately. |
|
Something failed in a way the user should know about. |
|
A reminder became due. |
|
The agent needs the user's permission (human-in-the-loop) or no longer does. |
|
The user started or ended "hold until I'm finished". |
|
A skill's focused mode was switched on or off (by the toggle or by a spoken command). |
|
The global hotkey was pressed or released: the page starts or stops its microphone. |
|
The notes store changed; the UI should refresh its notes panel. |
|
Latency metrics of a finished turn. |
|
Fan-out pub/sub over asyncio queues. |
Module Contents¶
- class voicemate.events.Lane[source]¶
Bases:
enum.StrEnumPipeline stage shown as one status lane in the UI.
Initialize self. See help(type(self)) for accurate signature.
- LISTENING = 'listening'¶
- TRANSCRIBING = 'transcribing'¶
- RECALLING = 'recalling'¶
- THINKING = 'thinking'¶
- TOOL = 'tool'¶
- GENERATING = 'generating'¶
- SYNTHESIZING = 'synthesizing'¶
- SPEAKING = 'speaking'¶
- class voicemate.events.LaneState[source]¶
Bases:
enum.StrEnumState of a lane.
Initialize self. See help(type(self)) for accurate signature.
- IDLE = 'idle'¶
- ACTIVE = 'active'¶
- DONE = 'done'¶
- voicemate.events.ToolSource¶
- class voicemate.events.StatusEvent[source]¶
A lane changed state.
- Variables:
lane – The pipeline stage.
state – Its new state.
detail – Optional detail, e.g. the tool name.
ts – Unix timestamp.
- detail: str = ''¶
- ts: float¶
- class voicemate.events.TranscriptEvent[source]¶
Recognized user speech (or typed text).
- Variables:
text – The transcript.
final – False for live partial transcripts while the user is still speaking.
lang – Detected language code (
"hu"or"en").merged – True when this text continues the previous, cut-off question and replaces it.
- text: str¶
- final: bool¶
- lang: str = ''¶
- merged: bool = False¶
- class voicemate.events.TokenEvent[source]¶
A streamed piece of the assistant reply.
- Variables:
text – The new text.
- text: str¶
- class voicemate.events.ReplyEvent[source]¶
The complete assistant reply of a turn.
- Variables:
text – Full reply text.
interrupted – True when the user barged in before the reply finished.
- text: str¶
- interrupted: bool = False¶
- class voicemate.events.ToolEvent[source]¶
A tool call started or finished.
- Variables:
name – Tool name.
phase –
"start"or"end".args – Tool arguments.
source – Where the result came from (only meaningful at
"end").summary – Short human-readable description (e.g. the query sent to the web).
- name: str¶
- phase: Literal['start', 'end']¶
- args: dict[str, Any]¶
- source: ToolSource = 'local'¶
- summary: str = ''¶
- class voicemate.events.AudioEvent[source]¶
A chunk of synthesized speech for the browser to play.
- Variables:
pcm – Mono signed 16-bit little-endian PCM.
sample_rate – Sample rate of
pcmin Hz.
- pcm: bytes¶
- sample_rate: int¶
- class voicemate.events.ErrorEvent[source]¶
Something failed in a way the user should know about.
- Variables:
message – Human-readable error.
- message: str¶
- class voicemate.events.ReminderEvent[source]¶
A reminder became due.
- Variables:
text – Reminder text.
- text: str¶
- class voicemate.events.ConfirmEvent[source]¶
The agent needs the user’s permission (human-in-the-loop) or no longer does.
- Variables:
question – The question; empty when the confirmation was answered.
open – True while waiting for the answer.
- question: str¶
- open: bool = True¶
- class voicemate.events.HoldEvent[source]¶
The user started or ended “hold until I’m finished”.
- Variables:
holding – True while pauses do not end the user’s turn.
- holding: bool¶
- class voicemate.events.FocusEvent[source]¶
A skill’s focused mode was switched on or off (by the toggle or by a spoken command).
- Variables:
on –
Truewhile the skill is focused.
- on: bool¶
- class voicemate.events.MicCommandEvent[source]¶
The global hotkey was pressed or released: the page starts or stops its microphone.
- Variables:
on –
Truewhile the hotkey is held,Falseonce it is released.
- on: bool¶
- class voicemate.events.NotesChangedEvent[source]¶
The notes store changed; the UI should refresh its notes panel.
- class voicemate.events.MetricsEvent[source]¶
Latency metrics of a finished turn.
- Variables:
metrics – Mapping of metric name to value (seconds or counts).
- metrics: dict[str, Any]¶
- voicemate.events.Event¶
- class voicemate.events.EventBus(maxsize: int = 1000)[source]¶
Fan-out pub/sub over asyncio queues.
Publishing never blocks: when a subscriber falls behind, its oldest event is dropped.
- Parameters:
maxsize – Per-subscriber queue capacity.