Skip to content

API Reference parrot_formdesigner.audio.events

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

parrot_formdesigner.audio.events

View source

Audio form protocol v2 events (FEAT-649).

Client inbound messages, adapter-internal events, wire messages and I/O requests exchanged between AudioFormSession (engine) and the WS adapter.

Class AnswerAccepted

Attributes:

Attribute Type Description
type Literal['answer_accepted']
field_id str
source str
value Any
matched OptionMatch | None
blob_ref str | None

Class AnswerCleared

Attributes:

Attribute Type Description
type Literal['answer_cleared']
field_id str

Class AnswerPayload

Attributes:

Attribute Type Description
type Literal['answer_payload']
field_id str
value Any

Class AnswerRejected

Attributes:

Attribute Type Description
type Literal['answer_rejected']
field_id str
error str
code str | None
value Any

Class AnswerSelection

Attributes:

Attribute Type Description
type Literal['answer_selection']
field_id str
value Any
values list[Any] | None

Class AnswerText

Attributes:

Attribute Type Description
type Literal['answer_text']
field_id str
value str

Class AudioReceived

Attributes:

Attribute Type Description
type Literal['_audio']
audio bytes
mime str | None

Class AudioSegment

Attributes:

Attribute Type Description
type Literal['audio_segment']
key str
mime str
kind str
text str

Class BlobStored

Attributes:

Attribute Type Description
type Literal['_blob_stored']
field_id str
blob_ref str
version int

Attribute ClientInbound

Class CommandAck

Attributes:

Attribute Type Description
type Literal['command_ack']
command str
field_id str | None

Class ConfirmAnswer

Attributes:

Attribute Type Description
type Literal['confirm_answer']
field_id str
confirmed bool

Class ConfirmRequest

Attributes:

Attribute Type Description
type Literal['confirm_request']
field_id str
transcript str
confidence float | None
matched OptionMatch | None
alternatives list[OptionMatch] | None
purpose Literal['answer', 'stop']
value Any
refined_by Literal['rules', 'llm'] | None

Class DeleteBlob

Attributes:

Attribute Type Description
type Literal['_delete_blob']
blob_ref str

Class EndSession

Attributes:

Attribute Type Description
type Literal['end_session']

Class Error

Attributes:

Attribute Type Description
type Literal['error']
code str
message str
session_id str | None
form_uid str | None

Class FormComplete

Attributes:

Attribute Type Description
type Literal['form_complete']
submission_id str
answers dict[str, Any]
stored_in str | None
plausibility_summary dict[str, Any] | None

Class GoBack

Attributes:

Attribute Type Description
type Literal['go_back']
to_field_id str | None
to_index int | None

Class IOFailed

Attributes:

Attribute Type Description
type Literal['_io_failed']
request str
code str
detail str | None

Attribute IORequest

Attribute InboundEvent

Attribute Outbound

Alias Phase

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

Class Ping

Attributes:

Attribute Type Description
type Literal['ping']

Class PlanReady

Attributes:

Attribute Type Description
type Literal['_plan_ready']
plan list[str]
delta dict[str, Any]

Class PlanUpdated

Attributes:

Attribute Type Description
type Literal['plan_updated']
order list[str]
hidden list[str]
cleared list[str]
required_changed dict[str, bool]
hidden_by_cap list[str]

Class PlausibilityDone

Attributes:

Attribute Type Description
type Literal['_plausibility_done']
report PlausibilityReport

Class PlausibilityResult

Attributes:

Attribute Type Description
type Literal['plausibility_result']
status Literal['ok', 'skipped', 'blocked']
items dict[str, PlausibilityVerdict]
reason str | None

Class Pong

Attributes:

Attribute Type Description
type Literal['pong']

Class Question

Attributes:

Attribute Type Description
type Literal['question']
index int
field_id str
label str
required bool
field_type str
voice_mode str
render_mode str
sensitive bool
description str | None
audio str | None
options list[dict[str, Any]] | None
fallback_html str | None
hint str | None
section_uid str | None
ui_cue UiCue | None
answer_modes list[str] | None
narration NarrationPlan | None

Class QuestionSkipped

Attributes:

Attribute Type Description
type Literal['question_skipped']
field_id str
reason str

Class RefineValue

Engine → adapter: ask the LLM post-processor to correct one spoken value (FEAT-653).

Attributes:

Attribute Type Description
type Literal['_refine_value']
field_id str
request_id str
transcript str
candidate Any
field_type str
label str
today str

Class RepeatQuestion

Attributes:

Attribute Type Description
type Literal['repeat_question']

Class Replan

Attributes:

Attribute Type Description
type Literal['_replan']

Class ReviewConfirm

Attributes:

Attribute Type Description
type Literal['review_confirm']
confirmed bool

Class ReviewEdit

Attributes:

Attribute Type Description
type Literal['review_edit']
field_id str

Class ReviewItem

Attributes:

Attribute Type Description
type Literal['review_item']
item ReviewItemData

Class ReviewPrompt

Attributes:

Attribute Type Description
type Literal['review_prompt']
text str | None

Class ReviewStart

Attributes:

Attribute Type Description
type Literal['review_start']
items list[ReviewItemData]

Class RunPlausibility

Attributes:

Attribute Type Description
type Literal['_run_plausibility']
fields set[str] | None

Class SaveSnapshot

Attributes:

Attribute Type Description
type Literal['_save_snapshot']
snapshot dict[str, Any]

Class SectionEnter

Attributes:

Attribute Type Description
type Literal['section_enter']
section_uid str
title str | None

Class SessionEnded

Attributes:

Attribute Type Description
type Literal['session_ended']
session_id str

Class SessionResumed

Attributes:

Attribute Type Description
type Literal['session_resumed']
session_id str
phase Phase
cursor str | None
answered list[str]

Class SessionStarted

Attributes:

Attribute Type Description
type Literal['session_started']
session_id str
total_questions int
title str
protocol_version int
hands_free HandsFreeConfig | None
max_recording_seconds int | None
prefetch_count int | None

Class SkipQuestion

Attributes:

Attribute Type Description
type Literal['skip_question']
field_id str | None

Class SnapshotSaved

Attributes:

Attribute Type Description
type Literal['_snapshot_saved']
revision int

Class StartSession

Attributes:

Attribute Type Description
type Literal['start_session']
form_uid str
locale str
protocol_version int
prefetch bool
resume_session_id str | None
stt_confirm_threshold float | None
tts_backend Literal['supertonic', 'google'] | None
tts_voice str | None
tts_mime_format str | None
auto_advance bool | None
enumerate_options bool | None
timezone str | None
submit_mode Literal['server', 'client']

Class StoreBlob

Attributes:

Attribute Type Description
type Literal['_store_blob']
field_id str
audio bytes
mime str
version int

Class Submit

Attributes:

Attribute Type Description
type Literal['_submit']
data dict[str, Any]
context dict[str, Any] | None

Class SubmitDone

Attributes:

Attribute Type Description
type Literal['_submit_done']
outcome dict[str, Any]

Class Synthesize

Attributes:

Attribute Type Description
type Literal['_synthesize']
keys list[str]
texts dict[str, str]

Class Transcribe

Attributes:

Attribute Type Description
type Literal['_transcribe']
field_id str
audio bytes
mime str | None

Class TranscriptReady

Attributes:

Attribute Type Description
type Literal['_transcript']
field_id str
text str
language str | None
confidence float | None
audio_mime str
audio_bytes_len int
duration_ms int | None

Class Transcription

Attributes:

Attribute Type Description
type Literal['transcription']
field_id str
text str
confidence float | None

Class UnknownMessageType

Raised by parse_inbound for an unknown or internal message type.

Class ValidationErrors

Attributes:

Attribute Type Description
type Literal['validation_errors']
errors dict[str, list[str]]
first_field_id str | None

Class ValueRefined

Adapter → engine: result of a RefineValue request (FEAT-653).

Attributes:

Attribute Type Description
type Literal['_value_refined']
field_id str
request_id str
status Literal['ok', 'failed', 'unavailable']
value str | None
confidence float | None

Attribute WireMessage

Function is_io_request

True when item is an I/O request the adapter must perform.

is_io_request(item: object) -> bool

Parameter Type Default Description
item object

Returns: bool

Function parse_inbound

Parse one client JSON message.

v1 (protocol_version < 2): unknown keys are dropped before validation (S6). v2: strict (extra="forbid"). Internal _* types are never accepted.

parse_inbound(data: dict[str, Any], *, protocol_version: int = 1) -> BaseModel

Parameter Type Default Description
data dict[str, Any]
protocol_version int 1

Returns: BaseModel

Raises:

  • UnknownMessageType — unknown or internal type.
  • pydantic.ValidationError — malformed payload.

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