ToolChoice

sealed class ToolChoice

Defines which tools the model should request when invoked. For more information, see Use a tool to complete an Amazon Bedrock model response.

Inheritors

Types

Link copied to clipboard
data class Any(val value: AnyToolChoice) : ToolChoice

Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.

Link copied to clipboard
data class Auto(val value: AutoToolChoice) : ToolChoice

Defines tools. The model automatically decides whether to call a tool or to generate text instead.

Link copied to clipboard
Link copied to clipboard
data class Tool(val value: SpecificToolChoice) : ToolChoice

Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.

Functions

Link copied to clipboard

Casts this ToolChoice as a Any and retrieves its aws.sdk.kotlin.services.bedrockagent.model.AnyToolChoice value. Throws an exception if the ToolChoice is not a Any.

Link copied to clipboard

Casts this ToolChoice as a Any and retrieves its aws.sdk.kotlin.services.bedrockagent.model.AnyToolChoice value. Returns null if the ToolChoice is not a Any.

Link copied to clipboard

Casts this ToolChoice as a Auto and retrieves its aws.sdk.kotlin.services.bedrockagent.model.AutoToolChoice value. Throws an exception if the ToolChoice is not a Auto.

Link copied to clipboard

Casts this ToolChoice as a Auto and retrieves its aws.sdk.kotlin.services.bedrockagent.model.AutoToolChoice value. Returns null if the ToolChoice is not a Auto.

Link copied to clipboard

Casts this ToolChoice as a Tool and retrieves its aws.sdk.kotlin.services.bedrockagent.model.SpecificToolChoice value. Throws an exception if the ToolChoice is not a Tool.

Link copied to clipboard

Casts this ToolChoice as a Tool and retrieves its aws.sdk.kotlin.services.bedrockagent.model.SpecificToolChoice value. Returns null if the ToolChoice is not a Tool.