Skip to content

API Reference parrot_formdesigner.core.voice

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

parrot_formdesigner.core.voice

View source

Voice-mode configuration models and helpers (FEAT-649).

Alias AudioSessionConfig

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

Alias FieldType

Re-exported from parrot_formdesigner.core.types.FieldType.

Class FieldVoiceMeta

Per-field voice settings parsed from FormField.meta["voice"].

Fields:

Field Type Default Description
prompt str | None None
enumerate Literal['auto', 'always', 'never', 'count_only'] 'auto'
confirm Literal['auto', 'always', 'never'] 'auto'
pause_ms int | None None
ui_cue UiCue | None None
match_threshold float | None None
skip_in_review bool False
commands Literal['on', 'off'] 'on'
sensitive bool False
normalize bool True
llm_refine bool | None None
option_pause_ms int | None None

Alias FormField

Re-exported from parrot_formdesigner.core.schema.FormField.

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

Class HandsFreeConfig

Client hands-free behaviour: auto-open mic after TTS, end-of-speech silence, barge-in.

barge_in (default True) tells the client it MAY keep the microphone armed with VAD while narration segments play and cancel playback on speech onset. It is a client policy and a ceiling: the client must still disable it when echo cancellation is not effective or the user opts out, and never enables it when the form says False. The server already accepts a recording at any time during ASKING/CONFIRMING and never learns playback was interrupted.

Fields:

Field Type Default Description
auto_record bool True
silence_ms int 1200
barge_in bool True

Attribute LLM_REFINE_TIMEOUT_MAX_S

Type: float

Class UiCue

Visual cue telling the client which control to focus/highlight.

Fields:

Field Type Default Description
control str
focus bool True
highlight bool True
submit_via Literal['voice', 'control', 'both'] 'both'

Class VoiceFormConfig

Per-form voice settings (FormSchema.voice).

Fields:

Field Type Default Description
enabled bool True
max_questions int | None 10
hint_pause_ms int 600
option_pause_ms int 500
enumerate_options bool True
stt_confirm_threshold float 0.6
option_match_threshold float 0.8
review Literal['always', 'never', 'ask'] 'always'
review_playback Literal['tts', 'recording', 'both'] 'tts'
store_recordings bool True
resume_ttl_seconds int 3600
llm_refine_options bool False
llm_refine_values bool False
llm_refine_threshold float 0.8
llm_refine_timeout_s float 4.0
commands Literal['on', 'off'] 'on'
hands_free HandsFreeConfig
tts_backend Literal['supertonic', 'google'] 'supertonic'
tts_voice str | None None
max_recording_seconds int 60

Function field_voice_meta

Parse field.meta["voice"] into a FieldVoiceMeta.

Unknown keys are ignored with ONE warning per call; an absent or invalid block yields defaults (invalid also logs a warning). Never raises.

field_voice_meta(field: FormField, *, logger: logging.Logger | None = None) -> FieldVoiceMeta

Parameter Type Default Description
field FormField
logger logging.Logger | None None

Returns: FieldVoiceMeta

Function is_sensitive

Single sensitivity policy (S8).

True when the field is a PASSWORD or meta["voice"]["sensitive"] is True. Used by narration, review, plausibility eligibility, logging and form_complete.

is_sensitive(field: FormField) -> bool

Parameter Type Default Description
field FormField

Returns: bool

Function resolve_voice_config

Return the effective voice config for a session.

Starts from form.voice (or defaults). A session config may only TIGHTEN it: thresholds may go up, caps may go down, features may be switched off — never the reverse.

resolve_voice_config(form: FormSchema, session: AudioSessionConfig | None) -> VoiceFormConfig

Parameter Type Default Description
form FormSchema
session AudioSessionConfig | None

Returns: VoiceFormConfig

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