commonMain.aws.sdk.kotlin.services.bedrockagent.model.HierarchicalChunkingLevelConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Token settings for a layer in a hierarchical chunking configuration.
*/
public class HierarchicalChunkingLevelConfiguration private constructor(builder: Builder) {
/**
* The maximum number of tokens that a chunk can contain in this layer.
*/
public val maxTokens: kotlin.Int = requireNotNull(builder.maxTokens) { "A non-null value must be provided for maxTokens" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.HierarchicalChunkingLevelConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("HierarchicalChunkingLevelConfiguration(")
append("maxTokens=$maxTokens")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = maxTokens
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 HierarchicalChunkingLevelConfiguration
if (maxTokens != other.maxTokens) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.HierarchicalChunkingLevelConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The maximum number of tokens that a chunk can contain in this layer.
*/
public var maxTokens: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.HierarchicalChunkingLevelConfiguration) : this() {
this.maxTokens = x.maxTokens
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.HierarchicalChunkingLevelConfiguration = HierarchicalChunkingLevelConfiguration(this)
internal fun correctErrors(): Builder {
if (maxTokens == null) maxTokens = 0
return this
}
}
}