AIMessage

interface AIMessage

A message in a conversation with an AI agent, as AIConversation shows it.

Implement it on your own message type, such as one wrapping a Stream Chat message, rather than converting: the conversation hands your message back in its views' params, so cast it there to read what else it holds.

Properties

Link copied to clipboard

What it carries besides its text, such as images and files.

Link copied to clipboard
abstract val id: String

The message's stable identity.

Link copied to clipboard

Whether the agent is still writing it.

Link copied to clipboard

The steps the agent took for it, in order: reasoning, tool calls, and kinds of its own.

Link copied to clipboard
abstract val role: AIMessageRole

Who wrote it.

Link copied to clipboard
abstract val text: String

What it says. A reply's text is Markdown.

Functions

Link copied to clipboard

The whole of a reasoning step's thinking when the app has it, such as from live updates. Without it, the step shows its own excerpt. It is read each time the conversation updates, so look it up rather than work it out.