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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.BedrockFoundationModelConfiguration.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

/**
 * Settings for a foundation model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) used to parse documents for a data source.
 */
public class BedrockFoundationModelConfiguration private constructor(builder: Builder) {
    /**
     * The ARN of the foundation model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html).
     */
    public val modelArn: kotlin.String = requireNotNull(builder.modelArn) { "A non-null value must be provided for modelArn" }
    /**
     * Instructions for interpreting the contents of a document.
     */
    public val parsingPrompt: aws.sdk.kotlin.services.bedrockagent.model.ParsingPrompt? = builder.parsingPrompt

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

    override fun toString(): kotlin.String = buildString {
        append("BedrockFoundationModelConfiguration(")
        append("modelArn=$modelArn,")
        append("parsingPrompt=$parsingPrompt")
        append(")")
    }

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

        if (modelArn != other.modelArn) return false
        if (parsingPrompt != other.parsingPrompt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ARN of the foundation model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html).
         */
        public var modelArn: kotlin.String? = null
        /**
         * Instructions for interpreting the contents of a document.
         */
        public var parsingPrompt: aws.sdk.kotlin.services.bedrockagent.model.ParsingPrompt? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.BedrockFoundationModelConfiguration) : this() {
            this.modelArn = x.modelArn
            this.parsingPrompt = x.parsingPrompt
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.ParsingPrompt] inside the given [block]
         */
        public fun parsingPrompt(block: aws.sdk.kotlin.services.bedrockagent.model.ParsingPrompt.Builder.() -> kotlin.Unit) {
            this.parsingPrompt = aws.sdk.kotlin.services.bedrockagent.model.ParsingPrompt.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (modelArn == null) modelArn = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy