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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains configurations for a prompt defined inline in the node.
 */
public class PromptFlowNodeInlineConfiguration private constructor(builder: Builder) {
    /**
     * Contains inference configurations for the prompt.
     */
    public val inferenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptInferenceConfiguration? = builder.inferenceConfiguration
    /**
     * The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) to run inference with.
     */
    public val modelId: kotlin.String = requireNotNull(builder.modelId) { "A non-null value must be provided for modelId" }
    /**
     * Contains a prompt and variables in the prompt that can be replaced with values at runtime.
     */
    public val templateConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateConfiguration? = builder.templateConfiguration
    /**
     * The type of prompt template.
     */
    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.PromptFlowNodeInlineConfiguration = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("PromptFlowNodeInlineConfiguration(")
        append("inferenceConfiguration=$inferenceConfiguration,")
        append("modelId=$modelId,")
        append("templateConfiguration=$templateConfiguration,")
        append("templateType=$templateType")
        append(")")
    }

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

        if (inferenceConfiguration != other.inferenceConfiguration) return false
        if (modelId != other.modelId) 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.PromptFlowNodeInlineConfiguration = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Contains inference configurations for the prompt.
         */
        public var inferenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptInferenceConfiguration? = null
        /**
         * The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) to run inference with.
         */
        public var modelId: kotlin.String? = null
        /**
         * Contains a prompt and variables in the prompt that can be replaced with values at runtime.
         */
        public var templateConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateConfiguration? = null
        /**
         * The type of prompt template.
         */
        public var templateType: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateType? = null

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy