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

commonMain.aws.sdk.kotlin.services.bedrock.model.HumanEvaluationCustomMetric.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrock.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * In a model evaluation job that uses human workers you must define the name of the metric, and how you want that metric rated `ratingMethod`, and an optional description of the metric.
 */
public class HumanEvaluationCustomMetric private constructor(builder: Builder) {
    /**
     * An optional description of the metric. Use this parameter to provide more details about the metric.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The name of the metric. Your human evaluators will see this name in the evaluation UI.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Choose how you want your human workers to evaluation your model. Valid values for rating methods are `ThumbsUpDown`, `IndividualLikertScale`,`ComparisonLikertScale`, `ComparisonChoice`, and `ComparisonRank`
     */
    public val ratingMethod: kotlin.String = requireNotNull(builder.ratingMethod) { "A non-null value must be provided for ratingMethod" }

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

    override fun toString(): kotlin.String = buildString {
        append("HumanEvaluationCustomMetric(")
        append("description=*** Sensitive Data Redacted ***,")
        append("name=*** Sensitive Data Redacted ***,")
        append("ratingMethod=$ratingMethod")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = description?.hashCode() ?: 0
        result = 31 * result + (name.hashCode())
        result = 31 * result + (ratingMethod.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 HumanEvaluationCustomMetric

        if (description != other.description) return false
        if (name != other.name) return false
        if (ratingMethod != other.ratingMethod) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An optional description of the metric. Use this parameter to provide more details about the metric.
         */
        public var description: kotlin.String? = null
        /**
         * The name of the metric. Your human evaluators will see this name in the evaluation UI.
         */
        public var name: kotlin.String? = null
        /**
         * Choose how you want your human workers to evaluation your model. Valid values for rating methods are `ThumbsUpDown`, `IndividualLikertScale`,`ComparisonLikertScale`, `ComparisonChoice`, and `ComparisonRank`
         */
        public var ratingMethod: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrock.model.HumanEvaluationCustomMetric) : this() {
            this.description = x.description
            this.name = x.name
            this.ratingMethod = x.ratingMethod
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy