commonMain.aws.sdk.kotlin.services.bedrockruntime.model.SystemContentBlock.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockruntime-jvm Show documentation
Show all versions of bedrockruntime-jvm Show documentation
The AWS Kotlin client for Bedrock Runtime
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
/**
* A system content block.
*/
public sealed class SystemContentBlock {
/**
* A content block to assess with the guardrail. Use with the [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) or [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) API operations.
*
* For more information, see *Use a guardrail with the Converse API* in the *Amazon Bedrock User Guide*.
*/
public data class GuardContent(val value: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConverseContentBlock) : aws.sdk.kotlin.services.bedrockruntime.model.SystemContentBlock() {
}
/**
* A system prompt for the model.
*/
public data class Text(val value: kotlin.String) : aws.sdk.kotlin.services.bedrockruntime.model.SystemContentBlock() {
}
public object SdkUnknown : aws.sdk.kotlin.services.bedrockruntime.model.SystemContentBlock() {
}
/**
* Casts this [SystemContentBlock] as a [GuardContent] and retrieves its [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConverseContentBlock] value. Throws an exception if the [SystemContentBlock] is not a
* [GuardContent].
*/
public fun asGuardContent(): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConverseContentBlock = (this as SystemContentBlock.GuardContent).value
/**
* Casts this [SystemContentBlock] as a [GuardContent] and retrieves its [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConverseContentBlock] value. Returns null if the [SystemContentBlock] is not a [GuardContent].
*/
public fun asGuardContentOrNull(): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailConverseContentBlock? = (this as? SystemContentBlock.GuardContent)?.value
/**
* Casts this [SystemContentBlock] as a [Text] and retrieves its [kotlin.String] value. Throws an exception if the [SystemContentBlock] is not a
* [Text].
*/
public fun asText(): kotlin.String = (this as SystemContentBlock.Text).value
/**
* Casts this [SystemContentBlock] as a [Text] and retrieves its [kotlin.String] value. Returns null if the [SystemContentBlock] is not a [Text].
*/
public fun asTextOrNull(): kotlin.String? = (this as? SystemContentBlock.Text)?.value
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy