Skip to content

API Reference parrot_formdesigner.api.dialect

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

parrot_formdesigner.api.dialect

View source

Dialect negotiation for the form contract endpoints (FEAT-650, spec §3 M2).

Effective dialect = ?dialect= query > Accept: application/a2ui+json > form.dialect. GET /forms/{uid} never consults this module.

Attribute A2UI_LIST_MAX

Attribute A2UI_MEDIA_TYPE

Attribute DIALECT_QUERY_PARAM

Class DialectError

A negotiation failure with an HTTP status and JSON payload.

Parameter Type Default Description
status int HTTP status code, either 400 or 415.
payload dict[str, Any] JSON response body for the client.

Alias FieldOption

Re-exported from parrot_formdesigner.core.options.FieldOption.

Alias FormDialect

Re-exported from parrot_formdesigner.core.FormDialect.

Alias FormField

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

Alias FormSchema

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

Alias FormSubsection

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

Alias RenderedForm

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

Alias get_renderer

Re-exported from parrot_formdesigner.api.render.get_renderer.

Attribute logger

Function overrides_to_envelopes

Translate shallow schema overrides into A2UI envelopes.

The translation follows the shallow override table in FEAT-650 spec §7.

overrides_to_envelopes(form: FormSchema, rendered: RenderedForm, overrides: Mapping[str, Any], *, locale: str = 'en') -> tuple[list[dict[str, Any]], list[str]]

Parameter Type Default Description
form FormSchema Source form schema.
rendered RenderedForm Existing A2UI render result.
overrides Mapping[str, Any] Shallow JSON Schema override mapping.
locale str 'en' BCP 47 locale selected for rendering.

Returns: tuple[list[dict[str, Any]], list[str]] — Serialized A2UI update envelopes and warnings for unsupported overrides.

Function render_a2ui_schema

Render a form through the registered A2UI renderer.

render_a2ui_schema(form: FormSchema, *, locale: str = 'en', overrides: Mapping[str, Any] | None = None) -> tuple[list[dict[str, Any]], RenderedForm, list[str]]

Parameter Type Default Description
form FormSchema Form schema to render.
locale str 'en' BCP 47 locale passed to the renderer.
overrides Mapping[str, Any] | None None Optional shallow schema overrides to translate.

Returns: tuple[list[dict[str, Any]], RenderedForm, list[str]] — A tuple of A2UI envelopes, the raw renderer result, and warning strings.

Raises:

  • RuntimeError — If an A2UI renderer is not registered.

Function resolve_dialect

Return the effective dialect for form on this request.

resolve_dialect(request: web.Request, form: FormSchema) -> FormDialect

Parameter Type Default Description
request web.Request Incoming request whose query and Accept header are negotiated.
form FormSchema Form whose stored dialect supplies the fallback.

Returns: FormDialect

Raises:

  • DialectError — When the query dialect is unknown or A2UI is unavailable.

Alias supported_formats

Re-exported from parrot_formdesigner.api.render.supported_formats.

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