Interface ButtonItem<TUserDefinedType>

This message item represents a link to a downloadable file.

interface ButtonItem<TUserDefinedType = Record<string, unknown>> {
    agent_message_type?: AgentMessageType;
    alt_text?: string;
    button_type: ButtonItemType;
    custom_event_name?: string;
    image_url?: string;
    kind?: ButtonItemKind;
    label?: string;
    message_options?: GenericItemMessageOptions;
    panel?: MessageItemPanelInfo;
    response_type: MessageResponseTypes;
    streaming_metadata?: ItemStreamingMetadata;
    target?: string;
    url?: string;
    user_defined?: TUserDefinedType;
    value?: { input: MessageInput };
}

Type Parameters

  • TUserDefinedType = Record<string, unknown>

Hierarchy (View Summary, Expand)

Properties

agent_message_type?: AgentMessageType

For messages that are sent between the user and a human agent, we assign an agent type to the message to distinguish what type it is.

alt_text?: string

The alt text for labeling the item. Screen readers will announce this text when the user's virtual cursor is focused on the item.

button_type: ButtonItemType

The type of button.

custom_event_name?: string

A custom event that can be listened to by web chat when the button item is clicked.

image_url?: string

The URL pointing to an image.

The style of button to display.

label?: string

The display text for the link.

message_options?: GenericItemMessageOptions

Options that control additional features available for a message item.

The panel options to display in a panel when the "show_panel" button type is clicked.

response_type: MessageResponseTypes

The response type of this message item.

streaming_metadata?: ItemStreamingMetadata

Metadata used identify a generic item within the context of a stream in order to correlate any updates meant for a specific item.

target?: string

Where to open the link. The default value is _self.

url?: string

The URL for the user to visit when the button is clicked.

user_defined?: TUserDefinedType

An optional buckets of additional user defined properties for this item.

value?: { input: MessageInput }

Type declaration

  • input: MessageInput

    An input object that should be sent back to the assistant when this option is chosen by a user.

MMNEPVFCICPMFPCPTTAAATR