
commonMain.aws.sdk.kotlin.services.bedrockagent.model.InferenceConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
/**
* Configuration for inference in prompt configuration
*/
public class InferenceConfiguration private constructor(builder: Builder) {
/**
* Maximum length of output
*/
public val maximumLength: kotlin.Int? = builder.maximumLength
/**
* List of stop sequences
*/
public val stopSequences: List? = builder.stopSequences
/**
* Controls randomness, higher values increase diversity
*/
public val temperature: kotlin.Float? = builder.temperature
/**
* Sample from the k most likely next tokens
*/
public val topK: kotlin.Int? = builder.topK
/**
* Cumulative probability cutoff for token selection
*/
public val topP: kotlin.Float? = builder.topP
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.InferenceConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("InferenceConfiguration(")
append("maximumLength=$maximumLength,")
append("stopSequences=$stopSequences,")
append("temperature=$temperature,")
append("topK=$topK,")
append("topP=$topP")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = maximumLength ?: 0
result = 31 * result + (stopSequences?.hashCode() ?: 0)
result = 31 * result + (temperature?.hashCode() ?: 0)
result = 31 * result + (topK ?: 0)
result = 31 * result + (topP?.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 InferenceConfiguration
if (maximumLength != other.maximumLength) return false
if (stopSequences != other.stopSequences) return false
if (temperature != other.temperature) return false
if (topK != other.topK) return false
if (topP != other.topP) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.InferenceConfiguration = Builder(this).apply(block).build()
public class Builder {
/**
* Maximum length of output
*/
public var maximumLength: kotlin.Int? = null
/**
* List of stop sequences
*/
public var stopSequences: List? = null
/**
* Controls randomness, higher values increase diversity
*/
public var temperature: kotlin.Float? = null
/**
* Sample from the k most likely next tokens
*/
public var topK: kotlin.Int? = null
/**
* Cumulative probability cutoff for token selection
*/
public var topP: kotlin.Float? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.InferenceConfiguration) : this() {
this.maximumLength = x.maximumLength
this.stopSequences = x.stopSequences
this.temperature = x.temperature
this.topK = x.topK
this.topP = x.topP
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.InferenceConfiguration = InferenceConfiguration(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy