commonMain.aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration.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
/**
* Contains details about the embeddings configuration of the knowledge base.
*/
public class KnowledgeBaseConfiguration private constructor(builder: Builder) {
/**
* The type of data that the data source is converted into for the knowledge base.
*/
public val type: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
/**
* Contains details about the embeddings model that'sused to convert the data source.
*/
public val vectorKnowledgeBaseConfiguration: aws.sdk.kotlin.services.bedrockagent.model.VectorKnowledgeBaseConfiguration? = builder.vectorKnowledgeBaseConfiguration
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("KnowledgeBaseConfiguration(")
append("type=$type,")
append("vectorKnowledgeBaseConfiguration=$vectorKnowledgeBaseConfiguration")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = type.hashCode()
result = 31 * result + (vectorKnowledgeBaseConfiguration?.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 KnowledgeBaseConfiguration
if (type != other.type) return false
if (vectorKnowledgeBaseConfiguration != other.vectorKnowledgeBaseConfiguration) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The type of data that the data source is converted into for the knowledge base.
*/
public var type: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseType? = null
/**
* Contains details about the embeddings model that'sused to convert the data source.
*/
public var vectorKnowledgeBaseConfiguration: aws.sdk.kotlin.services.bedrockagent.model.VectorKnowledgeBaseConfiguration? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration) : this() {
this.type = x.type
this.vectorKnowledgeBaseConfiguration = x.vectorKnowledgeBaseConfiguration
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.KnowledgeBaseConfiguration = KnowledgeBaseConfiguration(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.VectorKnowledgeBaseConfiguration] inside the given [block]
*/
public fun vectorKnowledgeBaseConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.VectorKnowledgeBaseConfiguration.Builder.() -> kotlin.Unit) {
this.vectorKnowledgeBaseConfiguration = aws.sdk.kotlin.services.bedrockagent.model.VectorKnowledgeBaseConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
if (type == null) type = KnowledgeBaseType.SdkUnknown("no value provided")
return this
}
}
}