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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseFlowNodeConfiguration.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 knowledge base node in a flow. This node takes a query as the input and returns, as the output, the retrieved responses directly (as an array) or a response generated based on the retrieved responses. For more information, see [Node types in Amazon Bedrock works](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) in the Amazon Bedrock User Guide.
 */
public class KnowledgeBaseFlowNodeConfiguration private constructor(builder: Builder) {
    /**
     * The unique identifier of the knowledge base to query.
     */
    public val knowledgeBaseId: kotlin.String = requireNotNull(builder.knowledgeBaseId) { "A non-null value must be provided for knowledgeBaseId" }
    /**
     * The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.
     */
    public val modelId: kotlin.String? = builder.modelId

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

    override fun toString(): kotlin.String = buildString {
        append("KnowledgeBaseFlowNodeConfiguration(")
        append("knowledgeBaseId=$knowledgeBaseId,")
        append("modelId=$modelId")
        append(")")
    }

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

        if (knowledgeBaseId != other.knowledgeBaseId) return false
        if (modelId != other.modelId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The unique identifier of the knowledge base to query.
         */
        public var knowledgeBaseId: kotlin.String? = null
        /**
         * The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.
         */
        public var modelId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseFlowNodeConfiguration) : this() {
            this.knowledgeBaseId = x.knowledgeBaseId
            this.modelId = x.modelId
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy