Skip to content

API Reference parrot_formdesigner.renderers.teams

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

parrot_formdesigner.renderers.teams

View source

MS Teams renderer for FormSchema — Adaptive Card + _formdesigner submit envelope (FEAT-551).

The renderer returns JSON only. The Teams bot (ai-parrot-integrations) unwraps the envelope and POSTs the answers to submit_url; see wiki/integrations/formdesigner-msteams-renderer.md.

Alias AdaptiveCardRenderer

Re-exported from parrot_formdesigner.renderers.adaptive_card.AdaptiveCardRenderer.

Attribute ENVELOPE_KEY

Type: str

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.

Attribute PUBLIC_URL_ENV

Type: str

Attribute RESERVED_CONTROL_KEYS

Type: frozenset[str]

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.

Class TeamsFormRenderer

FormSchema -> MS Teams Adaptive Card whose terminal Submit carries a TeamsSubmitEnvelope.

Parameter Type Default Description
public_base_url str | None None
api_base_path str '/api/v1'
ui_base_path str ''
signing_secret str | None None
version str | None None

Method TeamsFormRenderer.build_envelope

Compose submit_url/form_url from the configured base URL; raises TeamsRenderConfigError when unset.

build_envelope(form: FormSchema, tenant: str) -> TeamsSubmitEnvelope

Parameter Type Default Description
form FormSchema
tenant str

Returns: TeamsSubmitEnvelope

Method TeamsFormRenderer.render

Render via the base class, then attach metadata with the envelope (spec §3 M1).

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

Parameter Type Default Description
form FormSchema
style StyleSchema | None None
locale str 'en'
prefilled dict[str, Any] | None None
errors dict[str, str] | None None
tenant str | None None

Returns: RenderedForm

Method TeamsFormRenderer.render_section

Render a wizard step via the base class; the terminal step's Submit carries the envelope.

Mirrors render()'s tenant-resolution pattern (spec §7): _current_tenant and _current_form_url are set immediately before delegating to the base builder so _submit_action_data/_build_upload_element can use them synchronously.

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, tenant: str | None = None) -> RenderedForm

Parameter Type Default Description
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
tenant str | None None

Returns: RenderedForm

Class TeamsRenderConfigError

Raised when absolute URLs cannot be built (no public base URL or no tenant).

Class TeamsSubmitEnvelope

Routing envelope carried in Action.Submit.data["_formdesigner"] (spec §2 Data Models).

Fields:

Field Type Default Description
v Literal[1] 1
wire Literal['legacy'] 'legacy'
form_uid uuid.UUID
tenant str
form_version str
is_public bool
submit_url HttpUrl
form_url HttpUrl
sig str | None None

Method TeamsSubmitEnvelope.canonical_payload

Bytes that sign/verify cover: every field except sig, sorted keys, compact separators.

canonical_payload() -> bytes

Returns: bytes

Method TeamsSubmitEnvelope.sign

Return a copy whose sig is the HMAC-SHA256 hex digest of canonical_payload().

sign(secret: str) -> 'TeamsSubmitEnvelope'

Parameter Type Default Description
secret str

Returns: 'TeamsSubmitEnvelope'

Method TeamsSubmitEnvelope.verify

Constant-time check of sig; False when sig is None.

verify(secret: str) -> bool

Parameter Type Default Description
secret str

Returns: bool

Alias UPLOAD_FIELD_TYPES

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

Attribute UPLOAD_NOTICE_TEXT

Type: dict[str, str]

Attribute UPLOAD_WARNING_REASON

Type: str

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