Skip to content

Customize the chat experience

Every agent includes chat by default, so users can open it and start a conversation. The instructions you set for an agent guide its replies.

Chat is useful for working through a task with several steps or following up on a suggestion the agent makes. The sections below cover how replies are formatted, what content can appear in chat, and suggested actions.

Formatting

Chat replies can contain rich text, formatted as Markdown. See the table below for the formatting options supported.

Formatting Syntax Notes
Bold **text** or __text__
Italic *text* or _text_
Bold and italic ***text***
Inline code `code`
Fenced code block
```
const answer = 42;
```
Put an optional language after the opening fence.
Heading # through ###### Levels 4–6 share the same visual size.
Paragraph Blank line between blocks
Blockquote > quoted text Renders as regular body text.
Horizontal rule ---, ***, or ___ on its own line
Strikethrough ~~text~~
Unordered list - item or * item Indent child items to nest them.
Ordered list 1. item Indent child items to nest them.
Task list - [ ] open or - [x] done
Table
| A   | B   |
| --- | --- |
| 1   | 2   |
Link [label](https://example.com) Only https URLs supported.
Autolink https://example.com Only https URLs supported.
Image ![alt](https://example.com/img.png) See the images section below for restrictions.

HTML tags are not supported and appear as plain text.

Images

For security reasons, images will only be rendered if they were returned by a connector or use data URIs (starts with the data: scheme). See the connector Images guide for more information.

Images shown in chat are scaled and cropped to fit into a small square area. Overlay buttons are added to allow the user to quickly copy or download the image.

A generated dog photo in chat with copy and download controls

Multiple images shown in a row, without any other content between them, are shown in a carousel.

Two generated dog photos in a chat carousel

Suggested actions

While a chat box allows for flexible interactions, it requires users to know what to ask and spend time typing. You can improve your agent's user experience by adding suggested actions, which appear in the chat as buttons the user can click. These can advertise the agent's most common use cases and let users kick them off quickly.

Suggested actions under an agent's chat box

When a user clicks on an action, it sends the associated prompt to the agent, as if they typed it in the chat box. Use the addSuggestedPrompt() method to add a suggested action to your agent. You can add at most three (3) actions.

agent.addSuggestedPrompt({
  name: "CreatePost",
  displayName: "Create a social post",
  prompt: "Create a social post based on my writing.",
});