commonMain.aws.sdk.kotlin.services.bedrockagent.model.ToolConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Configuration information for the tools that the model can use when generating a response. For more information, see [Use a tool to complete an Amazon Bedrock model response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html).
*/
public class ToolConfiguration private constructor(builder: Builder) {
/**
* Defines which tools the model should request when invoked.
*/
public val toolChoice: aws.sdk.kotlin.services.bedrockagent.model.ToolChoice? = builder.toolChoice
/**
* An array of tools to pass to a model.
*/
public val tools: List = requireNotNull(builder.tools) { "A non-null value must be provided for tools" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.ToolConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ToolConfiguration(")
append("toolChoice=*** Sensitive Data Redacted ***,")
append("tools=*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = toolChoice?.hashCode() ?: 0
result = 31 * result + (tools.hashCode())
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as ToolConfiguration
if (toolChoice != other.toolChoice) return false
if (tools != other.tools) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.ToolConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Defines which tools the model should request when invoked.
*/
public var toolChoice: aws.sdk.kotlin.services.bedrockagent.model.ToolChoice? = null
/**
* An array of tools to pass to a model.
*/
public var tools: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.ToolConfiguration) : this() {
this.toolChoice = x.toolChoice
this.tools = x.tools
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.ToolConfiguration = ToolConfiguration(this)
internal fun correctErrors(): Builder {
if (tools == null) tools = emptyList()
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy