commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ToolUseBlock.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.content.Document
/**
* A tool use content block. Contains information about a tool that the model is requesting be run., The model uses the result from the tool to generate a response.
*/
public class ToolUseBlock private constructor(builder: Builder) {
/**
* The input to pass to the tool.
*/
public val input: aws.smithy.kotlin.runtime.content.Document? = builder.input
/**
* The name of the tool that the model wants to use.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The ID for the tool request.
*/
public val toolUseId: kotlin.String = requireNotNull(builder.toolUseId) { "A non-null value must be provided for toolUseId" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.ToolUseBlock = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ToolUseBlock(")
append("input=$input,")
append("name=$name,")
append("toolUseId=$toolUseId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = input?.hashCode() ?: 0
result = 31 * result + (name.hashCode())
result = 31 * result + (toolUseId.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 ToolUseBlock
if (input != other.input) return false
if (name != other.name) return false
if (toolUseId != other.toolUseId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.ToolUseBlock = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The input to pass to the tool.
*/
public var input: aws.smithy.kotlin.runtime.content.Document? = null
/**
* The name of the tool that the model wants to use.
*/
public var name: kotlin.String? = null
/**
* The ID for the tool request.
*/
public var toolUseId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.ToolUseBlock) : this() {
this.input = x.input
this.name = x.name
this.toolUseId = x.toolUseId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.ToolUseBlock = ToolUseBlock(this)
internal fun correctErrors(): Builder {
if (name == null) name = ""
if (toolUseId == null) toolUseId = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy