Skip to content

API Reference parrot_formdesigner.renderers.adaptive_card

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

parrot_formdesigner.renderers.adaptive_card

View source

Adaptive Card renderer for FormSchema.

Migrated and extended from parrot/integrations/msteams/dialogs/card_builder.py. Produces valid Adaptive Card JSON (schema v1.5) from FormSchema + StyleSchema.

Alias AbstractFormRenderer

Re-exported from parrot_formdesigner.renderers.base.AbstractFormRenderer.

Class AdaptiveCardRenderer

Renders FormSchema as Adaptive Card JSON for MS Teams.

Produces Adaptive Card v1.5 JSON that is compatible with the Bot Framework and MS Teams card rendering pipeline.

Supports:

  • Complete form rendering (all sections in one card)
  • Section-by-section wizard rendering
  • Summary/confirmation card
  • Error card
  • Prefilled values
  • Validation error display
  • i18n label resolution
Parameter Type Default Description
version str | None None Adaptive Card schema version. Defaults to "1.5".

Attributes:

Attribute Type Description
RENDERER_NAME str
accepts_tenant bool

Method AdaptiveCardRenderer.render

Render a complete FormSchema as an Adaptive Card.

In WIZARD layout mode, renders only the first section. In all other modes, renders all sections in one card.

render(form: FormSchema, style: StyleSchema | None = None, *, locale: str = 'en', prefilled: dict[str, Any] | None = None, errors: dict[str, str] | None = None) -> RenderedForm

Parameter Type Default Description
form FormSchema The form schema.
style StyleSchema | None None Style configuration. Defaults to SINGLE_COLUMN layout.
locale str 'en' Locale for i18n label resolution.
prefilled dict[str, Any] | None None Pre-filled field values.
errors dict[str, str] | None None Field-level error messages.

Returns: RenderedForm — RenderedForm with Adaptive Card dict as content.

Method AdaptiveCardRenderer.render_section

Render a single section as a wizard step Adaptive Card.

render_section(form: FormSchema, section_index: int, style: StyleSchema | None = None, *, locale: str = 'en', prefilled: dict[str, Any] | None = None, errors: dict[str, str] | None = None, show_back: bool = False, show_skip: bool = False) -> RenderedForm

Parameter Type Default Description
form FormSchema The form schema.
section_index int 0-based index of the section to render.
style StyleSchema | None None Style configuration.
locale str 'en' Locale for i18n resolution.
prefilled dict[str, Any] | None None Pre-filled field values.
errors dict[str, str] | None None Field-level error messages.
show_back bool False Whether to include a Back button.
show_skip bool False Whether to include a Skip button.

Returns: RenderedForm — RenderedForm with wizard step card as content.

Method AdaptiveCardRenderer.render_summary

Render a summary/confirmation card with submitted data.

render_summary(form: FormSchema, form_data: dict[str, Any], *, locale: str = 'en', summary_text: str | None = None) -> RenderedForm

Parameter Type Default Description
form FormSchema The form schema.
form_data dict[str, Any] All collected form data.
locale str 'en' Locale for i18n resolution.
summary_text str | None None Optional LLM-generated summary text.

Returns: RenderedForm — RenderedForm with summary confirmation card.

Method AdaptiveCardRenderer.render_error

Render an error card.

render_error(title: str, errors: list[str], *, locale: str = 'en', retry_action: bool = True) -> RenderedForm

Parameter Type Default Description
title str Error card title.
errors list[str] List of error messages to display.
locale str 'en' Locale for i18n.
retry_action bool True Whether to include a Try Again button.

Returns: RenderedForm — RenderedForm with error card.

Alias FallbackRenderer

Re-exported from parrot_formdesigner.renderers.base.FallbackRenderer.

Alias FieldRenderer

Re-exported from parrot_formdesigner.renderers.base.FieldRenderer.

Alias FieldType

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

Alias FormField

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

Alias FormSchema

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

Alias FormSection

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

Alias FormSubsection

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

Alias LocalizedString

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

Alias RenderWarning

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

Alias RenderedForm

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

Alias StyleSchema

Re-exported from parrot_formdesigner.core.style.StyleSchema.

Alias UPLOAD_FIELD_TYPES

Re-exported from parrot_formdesigner.core.file_envelope.UPLOAD_FIELD_TYPES.

Attribute logger

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