All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ToolResultBlock.kt Maven / Gradle / Ivy

There is a newer version: 1.3.80
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrockruntime.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A tool result block that contains the results for a tool request that the model previously made.
 */
public class ToolResultBlock private constructor(builder: Builder) {
    /**
     * The content for tool result content block.
     */
    public val content: List = requireNotNull(builder.content) { "A non-null value must be provided for content" }
    /**
     * The status for the tool result content block.
     *
     * This field is only supported Anthropic Claude 3 models.
     */
    public val status: aws.sdk.kotlin.services.bedrockruntime.model.ToolResultStatus? = builder.status
    /**
     * The ID of the tool request that this is the result for.
     */
    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.ToolResultBlock = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ToolResultBlock(")
        append("content=$content,")
        append("status=$status,")
        append("toolUseId=$toolUseId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = content.hashCode()
        result = 31 * result + (status?.hashCode() ?: 0)
        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 ToolResultBlock

        if (content != other.content) return false
        if (status != other.status) return false
        if (toolUseId != other.toolUseId) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.ToolResultBlock = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The content for tool result content block.
         */
        public var content: List? = null
        /**
         * The status for the tool result content block.
         *
         * This field is only supported Anthropic Claude 3 models.
         */
        public var status: aws.sdk.kotlin.services.bedrockruntime.model.ToolResultStatus? = null
        /**
         * The ID of the tool request that this is the result for.
         */
        public var toolUseId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.ToolResultBlock) : this() {
            this.content = x.content
            this.status = x.status
            this.toolUseId = x.toolUseId
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.ToolResultBlock = ToolResultBlock(this)

        internal fun correctErrors(): Builder {
            if (content == null) content = emptyList()
            if (toolUseId == null) toolUseId = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy