commonMain.aws.sdk.kotlin.services.bedrockagent.model.PromptVariant.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
import aws.smithy.kotlin.runtime.content.Document
/**
* Contains details about a variant of the prompt.
*/
public class PromptVariant private constructor(builder: Builder) {
/**
* Contains model-specific inference configurations that aren't in the `inferenceConfiguration` field. To see model-specific inference parameters, see [Inference request parameters and response fields for foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
*/
public val additionalModelRequestFields: aws.smithy.kotlin.runtime.content.Document? = builder.additionalModelRequestFields
/**
* Specifies a generative AI resource with which to use the prompt.
*/
public val genAiResource: aws.sdk.kotlin.services.bedrockagent.model.PromptGenAiResource? = builder.genAiResource
/**
* Contains inference configurations for the prompt variant.
*/
public val inferenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptInferenceConfiguration? = builder.inferenceConfiguration
/**
* An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.
*/
public val metadata: List? = builder.metadata
/**
* The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) with which to run inference on the prompt.
*/
public val modelId: kotlin.String? = builder.modelId
/**
* The name of the prompt variant.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* Contains configurations for the prompt template.
*/
public val templateConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateConfiguration? = builder.templateConfiguration
/**
* The type of prompt template to use.
*/
public val templateType: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateType = requireNotNull(builder.templateType) { "A non-null value must be provided for templateType" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.PromptVariant = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PromptVariant(")
append("*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = additionalModelRequestFields?.hashCode() ?: 0
result = 31 * result + (genAiResource?.hashCode() ?: 0)
result = 31 * result + (inferenceConfiguration?.hashCode() ?: 0)
result = 31 * result + (metadata?.hashCode() ?: 0)
result = 31 * result + (modelId?.hashCode() ?: 0)
result = 31 * result + (name.hashCode())
result = 31 * result + (templateConfiguration?.hashCode() ?: 0)
result = 31 * result + (templateType.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 PromptVariant
if (additionalModelRequestFields != other.additionalModelRequestFields) return false
if (genAiResource != other.genAiResource) return false
if (inferenceConfiguration != other.inferenceConfiguration) return false
if (metadata != other.metadata) return false
if (modelId != other.modelId) return false
if (name != other.name) return false
if (templateConfiguration != other.templateConfiguration) return false
if (templateType != other.templateType) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.PromptVariant = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Contains model-specific inference configurations that aren't in the `inferenceConfiguration` field. To see model-specific inference parameters, see [Inference request parameters and response fields for foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
*/
public var additionalModelRequestFields: aws.smithy.kotlin.runtime.content.Document? = null
/**
* Specifies a generative AI resource with which to use the prompt.
*/
public var genAiResource: aws.sdk.kotlin.services.bedrockagent.model.PromptGenAiResource? = null
/**
* Contains inference configurations for the prompt variant.
*/
public var inferenceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptInferenceConfiguration? = null
/**
* An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.
*/
public var metadata: List? = null
/**
* The unique identifier of the model or [inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) with which to run inference on the prompt.
*/
public var modelId: kotlin.String? = null
/**
* The name of the prompt variant.
*/
public var name: kotlin.String? = null
/**
* Contains configurations for the prompt template.
*/
public var templateConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateConfiguration? = null
/**
* The type of prompt template to use.
*/
public var templateType: aws.sdk.kotlin.services.bedrockagent.model.PromptTemplateType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.PromptVariant) : this() {
this.additionalModelRequestFields = x.additionalModelRequestFields
this.genAiResource = x.genAiResource
this.inferenceConfiguration = x.inferenceConfiguration
this.metadata = x.metadata
this.modelId = x.modelId
this.name = x.name
this.templateConfiguration = x.templateConfiguration
this.templateType = x.templateType
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.PromptVariant = PromptVariant(this)
internal fun correctErrors(): Builder {
if (name == null) name = ""
if (templateType == null) templateType = PromptTemplateType.SdkUnknown("no value provided")
return this
}
}
}