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

commonMain.aws.sdk.kotlin.services.qconnect.model.GenerativeDataDetails.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.qconnect.model



/**
 * Details about generative data.
 */
public class GenerativeDataDetails private constructor(builder: Builder) {
    /**
     * The LLM response.
     */
    public val completion: kotlin.String = requireNotNull(builder.completion) { "A non-null value must be provided for completion" }
    /**
     * Details about the generative content ranking data.
     */
    public val rankingData: aws.sdk.kotlin.services.qconnect.model.RankingData? = builder.rankingData
    /**
     * The references used to generative the LLM response.
     */
    public val references: List = requireNotNull(builder.references) { "A non-null value must be provided for references" }

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

    override fun toString(): kotlin.String = buildString {
        append("GenerativeDataDetails(")
        append("completion=*** Sensitive Data Redacted ***,")
        append("rankingData=$rankingData,")
        append("references=$references")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = completion.hashCode()
        result = 31 * result + (rankingData?.hashCode() ?: 0)
        result = 31 * result + (references.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 GenerativeDataDetails

        if (completion != other.completion) return false
        if (rankingData != other.rankingData) return false
        if (references != other.references) return false

        return true
    }

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

    public class Builder {
        /**
         * The LLM response.
         */
        public var completion: kotlin.String? = null
        /**
         * Details about the generative content ranking data.
         */
        public var rankingData: aws.sdk.kotlin.services.qconnect.model.RankingData? = null
        /**
         * The references used to generative the LLM response.
         */
        public var references: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qconnect.model.GenerativeDataDetails) : this() {
            this.completion = x.completion
            this.rankingData = x.rankingData
            this.references = x.references
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy