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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.PromptVariant.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains details about a variant of the prompt.
 */
public class PromptVariant private constructor(builder: Builder) {
    /**
     * Contains inference configurations for the prompt variant.
     */
    public val inferenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptInferenceConfiguration? = builder.inferenceConfiguration
    /**
     * An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant. For more information, see [Create a prompt using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html).
     */
    public val metadata: List? = builder.metadata
    /**
     * The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) with which to run inference on the prompt.
     */
    public val modelId: kotlin.String? = builder.modelId
    /**
     * The name of the prompt variant.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Contains configurations for the prompt template.
     */
    public val templateConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateConfiguration? = builder.templateConfiguration
    /**
     * The type of prompt template to use.
     */
    public val templateType: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateType = requireNotNull(builder.templateType) { "A non-null value must be provided for templateType" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.PromptVariant = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("PromptVariant(")
        append("*** Sensitive Data Redacted ***")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = inferenceConfiguration?.hashCode() ?: 0
        result = 31 * result + (metadata?.hashCode() ?: 0)
        result = 31 * result + (modelId?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (templateConfiguration?.hashCode() ?: 0)
        result = 31 * result + (templateType.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 PromptVariant

        if (inferenceConfiguration != other.inferenceConfiguration) return false
        if (metadata != other.metadata) return false
        if (modelId != other.modelId) return false
        if (name != other.name) return false
        if (templateConfiguration != other.templateConfiguration) return false
        if (templateType != other.templateType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Contains inference configurations for the prompt variant.
         */
        public var inferenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptInferenceConfiguration? = null
        /**
         * An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant. For more information, see [Create a prompt using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html).
         */
        public var metadata: List? = null
        /**
         * The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) with which to run inference on the prompt.
         */
        public var modelId: kotlin.String? = null
        /**
         * The name of the prompt variant.
         */
        public var name: kotlin.String? = null
        /**
         * Contains configurations for the prompt template.
         */
        public var templateConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateConfiguration? = null
        /**
         * The type of prompt template to use.
         */
        public var templateType: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.PromptVariant) : this() {
            this.inferenceConfiguration = x.inferenceConfiguration
            this.metadata = x.metadata
            this.modelId = x.modelId
            this.name = x.name
            this.templateConfiguration = x.templateConfiguration
            this.templateType = x.templateType
        }

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (templateType == null) templateType = PromptTemplateType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy