ContentBlock

sealed class ContentBlock

Contains the content for the message you pass to, or receive from a model. For more information, see Create a prompt using Prompt management.

Inheritors

Types

Link copied to clipboard
data class CachePoint(val value: CachePointBlock) : ContentBlock

Creates a cache checkpoint within a message.

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

The text in the message.

Functions

Link copied to clipboard

Casts this ContentBlock as a CachePoint and retrieves its aws.sdk.kotlin.services.bedrockagent.model.CachePointBlock value. Throws an exception if the ContentBlock is not a CachePoint.

Link copied to clipboard
Link copied to clipboard
fun asText(): String

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

Link copied to clipboard

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