Response

sealed interface Response : Message(source)

Represents a response message in the chat.

Inheritors

Properties

Link copied to clipboard
open val content: String

The textual content of the message aggregated from all ContentPart.Text parts joined to String separated by newlines.

Link copied to clipboard
abstract override val metaInfo: ResponseMetaInfo

Stores metadata information for the current message instance, such as token count and timestamp.

Link copied to clipboard
abstract val parts: List<ContentPart>

The content parts of the message. By default, if the message is a single text message, it will contain a single ContentPart.Text part. If the message contains multiple parts, it will contain an ordered list of ContentPart.Text and ContentPart.Attachment instances.

Link copied to clipboard
abstract val role: Message.Role

The role associated with the message.

Functions

Link copied to clipboard
abstract fun copy(updatedMetaInfo: ResponseMetaInfo): Message.Response

Creates a copy of the current Response instance with updated metadata.

Link copied to clipboard

Checks weather the message consists of attachments.

Link copied to clipboard

Checks weather the message consists of only sungle text content.

Link copied to clipboard