commonMain.aws.sdk.kotlin.services.bedrockruntime.model.GuardrailAssessment.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockruntime-jvm Show documentation
Show all versions of bedrockruntime-jvm Show documentation
The AWS Kotlin client for Bedrock Runtime
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A behavior assessment of the guardrail policies used in a call to the Converse API.
*/
public class GuardrailAssessment private constructor(builder: Builder) {
/**
* The content policy.
*/
public val contentPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContentPolicyAssessment? = builder.contentPolicy
/**
* The contextual grounding policy used for the guardrail assessment.
*/
public val contextualGroundingPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContextualGroundingPolicyAssessment? = builder.contextualGroundingPolicy
/**
* The invocation metrics for the guardrail assessment.
*/
public val invocationMetrics: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics? = builder.invocationMetrics
/**
* The sensitive information policy.
*/
public val sensitiveInformationPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailSensitiveInformationPolicyAssessment? = builder.sensitiveInformationPolicy
/**
* The topic policy.
*/
public val topicPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTopicPolicyAssessment? = builder.topicPolicy
/**
* The word policy.
*/
public val wordPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAssessment? = builder.wordPolicy
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailAssessment = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GuardrailAssessment(")
append("contentPolicy=$contentPolicy,")
append("contextualGroundingPolicy=$contextualGroundingPolicy,")
append("invocationMetrics=$invocationMetrics,")
append("sensitiveInformationPolicy=$sensitiveInformationPolicy,")
append("topicPolicy=$topicPolicy,")
append("wordPolicy=$wordPolicy")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = contentPolicy?.hashCode() ?: 0
result = 31 * result + (contextualGroundingPolicy?.hashCode() ?: 0)
result = 31 * result + (invocationMetrics?.hashCode() ?: 0)
result = 31 * result + (sensitiveInformationPolicy?.hashCode() ?: 0)
result = 31 * result + (topicPolicy?.hashCode() ?: 0)
result = 31 * result + (wordPolicy?.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 GuardrailAssessment
if (contentPolicy != other.contentPolicy) return false
if (contextualGroundingPolicy != other.contextualGroundingPolicy) return false
if (invocationMetrics != other.invocationMetrics) return false
if (sensitiveInformationPolicy != other.sensitiveInformationPolicy) return false
if (topicPolicy != other.topicPolicy) return false
if (wordPolicy != other.wordPolicy) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailAssessment = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The content policy.
*/
public var contentPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContentPolicyAssessment? = null
/**
* The contextual grounding policy used for the guardrail assessment.
*/
public var contextualGroundingPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContextualGroundingPolicyAssessment? = null
/**
* The invocation metrics for the guardrail assessment.
*/
public var invocationMetrics: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics? = null
/**
* The sensitive information policy.
*/
public var sensitiveInformationPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailSensitiveInformationPolicyAssessment? = null
/**
* The topic policy.
*/
public var topicPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTopicPolicyAssessment? = null
/**
* The word policy.
*/
public var wordPolicy: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAssessment? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailAssessment) : this() {
this.contentPolicy = x.contentPolicy
this.contextualGroundingPolicy = x.contextualGroundingPolicy
this.invocationMetrics = x.invocationMetrics
this.sensitiveInformationPolicy = x.sensitiveInformationPolicy
this.topicPolicy = x.topicPolicy
this.wordPolicy = x.wordPolicy
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailAssessment = GuardrailAssessment(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContentPolicyAssessment] inside the given [block]
*/
public fun contentPolicy(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContentPolicyAssessment.Builder.() -> kotlin.Unit) {
this.contentPolicy = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContentPolicyAssessment.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContextualGroundingPolicyAssessment] inside the given [block]
*/
public fun contextualGroundingPolicy(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContextualGroundingPolicyAssessment.Builder.() -> kotlin.Unit) {
this.contextualGroundingPolicy = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailContextualGroundingPolicyAssessment.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics] inside the given [block]
*/
public fun invocationMetrics(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics.Builder.() -> kotlin.Unit) {
this.invocationMetrics = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailSensitiveInformationPolicyAssessment] inside the given [block]
*/
public fun sensitiveInformationPolicy(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailSensitiveInformationPolicyAssessment.Builder.() -> kotlin.Unit) {
this.sensitiveInformationPolicy = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailSensitiveInformationPolicyAssessment.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTopicPolicyAssessment] inside the given [block]
*/
public fun topicPolicy(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTopicPolicyAssessment.Builder.() -> kotlin.Unit) {
this.topicPolicy = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailTopicPolicyAssessment.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAssessment] inside the given [block]
*/
public fun wordPolicy(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAssessment.Builder.() -> kotlin.Unit) {
this.wordPolicy = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailWordPolicyAssessment.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy