commonMain.aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeConfiguration.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 for a prompt node in the flow. You can use a prompt from Prompt management or you can define one in this node. If the prompt contains variables, the inputs into this node will fill in the variables. The output from this node is the response generated by the model. For more information, see [Node types in Amazon Bedrock works](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) in the Amazon Bedrock User Guide.
*/
public class PromptFlowNodeConfiguration private constructor(builder: Builder) {
/**
* Contains configurations for a guardrail to apply to the prompt in this node and the response generated from it.
*/
public val guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = builder.guardrailConfiguration
/**
* Specifies whether the prompt is from Prompt management or defined inline.
*/
public val sourceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeSourceConfiguration? = builder.sourceConfiguration
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PromptFlowNodeConfiguration(")
append("guardrailConfiguration=$guardrailConfiguration,")
append("sourceConfiguration=$sourceConfiguration")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = guardrailConfiguration?.hashCode() ?: 0
result = 31 * result + (sourceConfiguration?.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 PromptFlowNodeConfiguration
if (guardrailConfiguration != other.guardrailConfiguration) return false
if (sourceConfiguration != other.sourceConfiguration) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Contains configurations for a guardrail to apply to the prompt in this node and the response generated from it.
*/
public var guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = null
/**
* Specifies whether the prompt is from Prompt management or defined inline.
*/
public var sourceConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeSourceConfiguration? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeConfiguration) : this() {
this.guardrailConfiguration = x.guardrailConfiguration
this.sourceConfiguration = x.sourceConfiguration
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.PromptFlowNodeConfiguration = PromptFlowNodeConfiguration(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration] inside the given [block]
*/
public fun guardrailConfiguration(block: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration.Builder.() -> kotlin.Unit) {
this.guardrailConfiguration = aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}