Skip to content

Expand interactive card payload schemas in uagents-core #907

Description

@tejus3131

Prerequisites

  • I checked the documentation and made sure this feature does not already exist
  • I checked the existing issues to make sure this feature has not already been requested

Feature

Extend uagents_core.contrib.protocols.chat.cards so Python card payload validation matches the Agentverse interactive card spec (predefined cards + custom element-tree primitives).

#897 added basic interactive cards; current schemas are missing fields and validation that Agentverse drawer already supports.

Scope:

  • Predefined cards: carousel (style, root_cta, logo, DisplayImage images), detail (ExpandedChoice, hero media), form (cancel_cta, full input kinds), review (stricter CtaAction)
  • Shared: DisplayImage, HTTP URL + aspect_ratio validation, non-empty CTA selections
  • Custom element tree: VideoNode, LabelWithIcon button labels, button image/redirect/bypass_required_validation, InputNode parity with form fields (date/time/multiselect/phone), ChoiceGrid DisplayImage support, group gap >= 1

Outcome: agents using uagents-core emit/validate the same card payloads Agentverse clients render. Metadata wire format stays v1; no protocol digest change.

Additional Information (Optional)

Follow-up to #897.

Implementation: expand Pydantic models + validators in python/uagents-core/uagents_core/contrib/protocols/chat/cards/__init__.py.

Non-breaking for valid #897 payloads. Tighter validation may reject previously loose/invalid payloads (empty CTA selections, bad URLs, etc.) — intentional per spec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions