DocumentSource

sealed class DocumentSource

Contains the content of a document.

Inheritors

Types

Link copied to clipboard
data class Bytes(val value: ByteArray) : DocumentSource

The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64.

Link copied to clipboard

The structured content of the document source, which may include various content blocks such as text, images, or other document elements.

Link copied to clipboard
data class S3Location(val value: S3Location) : DocumentSource

The location of a document object in an Amazon S3 bucket. To see which models support S3 uploads, see Supported models and features for Converse.

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

The text content of the document source.

Functions

Link copied to clipboard

Casts this DocumentSource as a Bytes and retrieves its kotlin.ByteArray value. Throws an exception if the DocumentSource is not a Bytes.

Link copied to clipboard

Casts this DocumentSource as a Bytes and retrieves its kotlin.ByteArray value. Returns null if the DocumentSource is not a Bytes.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Casts this DocumentSource as a S3Location and retrieves its aws.sdk.kotlin.services.bedrockruntime.model.S3Location value. Throws an exception if the DocumentSource is not a S3Location.

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

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

Link copied to clipboard

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