Message

sealed class Message

A message in a conversation, either from the user or the assistant.

Inheritors

Types

Link copied to clipboard

A message from the assistant.

Link copied to clipboard
Link copied to clipboard
data class UserMessage(val value: List<UserMessageBlock>) : Message

A message from the user.

Functions

Link copied to clipboard

Casts this Message as a AssistantMessage and retrieves its kotlin.collections.List value. Throws an exception if the Message is not a AssistantMessage.

Link copied to clipboard

Casts this Message as a AssistantMessage and retrieves its kotlin.collections.List value. Returns null if the Message is not a AssistantMessage.

Link copied to clipboard

Casts this Message as a UserMessage and retrieves its kotlin.collections.List value. Throws an exception if the Message is not a UserMessage.

Link copied to clipboard

Casts this Message as a UserMessage and retrieves its kotlin.collections.List value. Returns null if the Message is not a UserMessage.