Skip to content

API Reference parrot.integrations.msteams.hitl_cards

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

parrot.integrations.msteams.hitl_cards

View source

Adaptive Card renderer for the Teams HITL channel.

Maps every :class:~parrot.human.models.InteractionType value to an Adaptive Card dict that includes interaction_id in every Action.Submit.data payload. The cards are designed for deterministic correlation: even when multiple pending interactions exist in the same 1:1 chat, the interaction_id field uniquely binds each card submit to its originating interaction.

Card structure (all cards):

  • Header TextBlock with the question.

  • Type-specific input controls.

  • One or more Action.Submit buttons where every data payload carries at minimum::

    {
        "hitl": true,
        "interaction_id": "<uuid>",
        # type-specific fields
    }
    

Policy-bound interactions can optionally include an "Escalar" action (data.value == ESCALATE_OPTION_KEY) when the channel's render_reject_button flag is True.

OQ-5 resolution -- form_schema -> Input.* mapping:

  • "string" -> Input.Text (single-line unless multiline: true)
  • "text" or "textarea" -> Input.Text (multiline)
  • "integer" or "number" -> Input.Number
  • "boolean" -> Input.Toggle
  • "choice" or "select" -> Input.ChoiceSet (compact, single)
  • "multi_choice" or "multi_select" -> Input.ChoiceSet (multi)
  • "date" -> Input.Date
  • "time" -> Input.Time
  • unknown / unrecognised -> Input.Text (fallback) Field required and placeholder keys are forwarded if present.

Alias ACElement

Re-exported from parrot.outputs.cards.elements.ACElement.

Alias ActionSubmit

Re-exported from parrot.outputs.cards.ActionSubmit.

Alias CardFormSection

Re-exported from parrot.outputs.cards.sections.FormSection.

Alias CardSection

Re-exported from parrot.outputs.cards.sections.CardSection.

Alias CardSpec

Re-exported from parrot.outputs.cards.CardSpec.

Alias ChoiceOption

Re-exported from parrot.human.models.ChoiceOption.

Alias DEFAULT_ADAPTIVE_CARD_VERSION

Re-exported from parrot.outputs.cards.DEFAULT_ADAPTIVE_CARD_VERSION.

Alias ESCALATE_OPTION_KEY

Re-exported from parrot.human.channels.base.ESCALATE_OPTION_KEY.

Alias FormFieldSpec

Re-exported from parrot.outputs.cards.FormFieldSpec.

Alias HumanInteraction

Re-exported from parrot.human.models.HumanInteraction.

Alias InputChoice

Re-exported from parrot.outputs.cards.InputChoice.

Alias InputChoiceSet

Re-exported from parrot.outputs.cards.InputChoiceSet.

Alias InputText

Re-exported from parrot.outputs.cards.InputText.

Alias InteractionType

Re-exported from parrot.human.models.InteractionType.

Alias RawElementsSection

Re-exported from parrot.outputs.cards.RawElementsSection.

Class TeamsCardRenderer

Pure renderer: :class:~parrot.human.models.HumanInteraction -> Adaptive Card dict.

All methods are synchronous (no I/O). The returned dict is JSON- serialisable and can be passed directly to CardFactory.adaptive_card or used in an Attachment body.

Parameter Type Default Description
render_reject_button bool True When True, policy-bound interactions receive an "escalate" submit action. Matches TeamsHumanChannel.render_reject_button.

Method TeamsCardRenderer.render

Render an Adaptive Card for the given interaction.

render(interaction: HumanInteraction, render_reject_button: Optional[bool] = None) -> Dict[str, Any]

Parameter Type Default Description
interaction HumanInteraction The pending human interaction.
render_reject_button Optional[bool] None Override the instance-level flag for this call only. Defaults to the constructor value.

Returns: Dict[str, Any] — An Adaptive Card dict ready for CardFactory.adaptive_card.

Method TeamsCardRenderer.render_disabled

Render a disabled/expired card variant for cancel/update.

Used by TeamsHumanChannel.cancel_interaction to replace the live card with a tombstone indicating the interaction is no longer active.

render_disabled(interaction_id: str, reason: str = 'expired') -> Dict[str, Any]

Parameter Type Default Description
interaction_id str The ID of the expired interaction.
reason str 'expired' Short human-readable reason (e.g. "expired", "withdrawn", "timeout").

Returns: Dict[str, Any] — An Adaptive Card dict in a greyed-out disabled style.

Alias TextBlock

Re-exported from parrot.outputs.cards.TextBlock.

Alias escalate_option

Re-exported from parrot.human.channels.base.escalate_option.

Alias render_card

Re-exported from parrot.outputs.cards.render.

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