Rich content schema
Instead of plain text, a bot turn can return a rich content payload: a list of components the SDK renders natively. The bot produces this; you rarely author it by hand, but this is the exact shape.
{ "type": "rich_content", "components": [ /* one or more components, in order */ ]}Every component has a type discriminator. Unknown types render as nothing (forward-compatible).
Components
text
Markdown (or plain) text.
| Field | Type | Default | Notes |
|---|---|---|---|
content | string | — | Markdown by default. |
format | markdown|plain | markdown |
card
Image + title + optional subtitle/description/metadata/actions.
| Field | Type | Notes |
|---|---|---|
id | string | Stable id. |
title | string | Required. |
image | RichImage | Optional. |
subtitle | string | Optional. |
description | string | Optional (clamped to a few lines in carousels). |
metadata | map<string,string> | e.g. {"price":"$29"}; price/badge get special styling. |
actions | RichAction[] | Buttons under the card. |
carousel
Horizontally-paged cards.
| Field | Type | Notes |
|---|---|---|
items | Component[] | Usually cards. |
config | CarouselConfig | autoPlay, autoPlayInterval, showIndicators, itemsVisible, spacing. |
product_list
Vertical list/grid of cards.
| Field | Type |
|---|---|
items | Component[] |
config | ProductListConfig |
image
A standalone image.
| Field | Type | Notes |
|---|---|---|
url | string | |
alt | string? | |
caption | string? | |
aspect_ratio | string | e.g. 16:9, 1:1. Default 16:9. |
actions | RichAction[] | Tap actions. |
on_tap_callback | OnTapCallback? | Fire a host callback on tap instead of the default zoom viewer. |
button_group
A row or column of buttons.
| Field | Type | Notes |
|---|---|---|
buttons | RichButton[] | Each wraps a RichAction. |
layout | horizontal|vertical | Default horizontal. |
swatch_grid
Colour swatches (e.g. shade pickers), wrapping rows.
| Field | Type | Notes |
|---|---|---|
swatches | RichSwatch[] | Each: hex, label, optional action. |
columns | int | Default 4. |
host_slot
A placeholder your app fills with its own native widget. See Host callbacks & actions.
| Field | Type | Notes |
|---|---|---|
slot_id | string | Your hostSlotBuilder maps this to a widget. |
payload | map? | Must fully re-render the slot on history reload — never key on local state. |
RichImage
Used by card and (as its own fields) image.
| Field | Type | Default | Notes |
|---|---|---|---|
url | string | — | Empty + loading:true → shimmer placeholder. |
alt | string? | null | |
aspect_ratio | string | 16:9 | width:height. |
loading | bool | false | Shimmer while an async tool runs; the host swaps in the final URL when done. |
on_tap_callback | OnTapCallback? | null |