UserMessageBlock

sealed class UserMessageBlock

A block of content in a user message.

Inheritors

Types

Link copied to clipboard
Link copied to clipboard
data class Text(val value: String) : UserMessageBlock

Text content from the user.

Link copied to clipboard
data class ToolResult(val value: <Error class: unknown class>) : UserMessageBlock

Tool execution result provided by the user.

Functions

Link copied to clipboard
fun asText(): String

Casts this UserMessageBlock as a Text and retrieves its kotlin.String value. Throws an exception if the UserMessageBlock is not a Text.

Link copied to clipboard

Casts this UserMessageBlock as a Text and retrieves its kotlin.String value. Returns null if the UserMessageBlock is not a Text.

Link copied to clipboard
fun asToolResult(): <Error class: unknown class>

Casts this UserMessageBlock as a ToolResult and retrieves its aws.smithy.kotlin.runtime.content.Document value. Throws an exception if the UserMessageBlock is not a ToolResult.

Link copied to clipboard
fun asToolResultOrNull(): <Error class: unknown class>?

Casts this UserMessageBlock as a ToolResult and retrieves its aws.smithy.kotlin.runtime.content.Document value. Returns null if the UserMessageBlock is not a ToolResult.