Skip to content

API Reference parrot_formdesigner.audio.commands

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.audio.commands

View source

Hands-free voice command classification (FEAT-649, Module 4).

Alias Lexicon

Re-exported from parrot_formdesigner.audio.narration.lexicon.Lexicon.

Alias Phase

Re-exported from parrot_formdesigner.audio.models.Phase.

Class VoiceCommand

Spoken commands recognised during an audio session.

Function classify_command

Whole-utterance match (<= max_tokens after normalize); fuzzy >= 0.9; YES/NO/SEND/CHANGE only in CONFIRMING/REVIEW.

classify_command(transcript: str, *, lexicon: Lexicon, phase: Phase, max_tokens: int = 4) -> VoiceCommand | None

Parameter Type Default Description
transcript str Raw transcript.
lexicon Lexicon Locale lexicon.
phase Phase Current engine phase (gates which commands are allowed).
max_tokens int 4 Maximum normalised token count for a command utterance.

Returns: VoiceCommand | None — The matched command, or None.

Function command_option_collisions

Option labels that normalise to a command phrase — used by tests and the optimiser self-test.

command_option_collisions(options: list[dict], lexicon: Lexicon) -> list[tuple[str, VoiceCommand]]

Parameter Type Default Description
options list[dict]
lexicon Lexicon

Returns: list[tuple[str, VoiceCommand]]

Alias normalize

Re-exported from parrot_formdesigner.audio.narration.lexicon.normalize.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally