commonMain.aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration.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 configurations to override prompts in different parts of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
*/
public class PromptOverrideConfiguration private constructor(builder: Builder) {
/**
* The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the `promptConfigurations` must contain a `parserMode` value that is set to `OVERRIDDEN`. For more information, see [Parser Lambda function in Amazon Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html).
*/
public val overrideLambda: kotlin.String? = builder.overrideLambda
/**
* Contains configurations to override a prompt template in one part of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
*/
public val promptConfigurations: List = requireNotNull(builder.promptConfigurations) { "A non-null value must be provided for promptConfigurations" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PromptOverrideConfiguration(")
append("*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = overrideLambda?.hashCode() ?: 0
result = 31 * result + (promptConfigurations.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 PromptOverrideConfiguration
if (overrideLambda != other.overrideLambda) return false
if (promptConfigurations != other.promptConfigurations) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence. If you specify this field, at least one of the `promptConfigurations` must contain a `parserMode` value that is set to `OVERRIDDEN`. For more information, see [Parser Lambda function in Amazon Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html).
*/
public var overrideLambda: kotlin.String? = null
/**
* Contains configurations to override a prompt template in one part of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
*/
public var promptConfigurations: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration) : this() {
this.overrideLambda = x.overrideLambda
this.promptConfigurations = x.promptConfigurations
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration = PromptOverrideConfiguration(this)
internal fun correctErrors(): Builder {
if (promptConfigurations == null) promptConfigurations = emptyList()
return this
}
}
}