updateAIGuardrail method
- required String aiGuardrailId,
- required String assistantId,
- required String blockedInputMessaging,
- required String blockedOutputsMessaging,
- required VisibilityStatus visibilityStatus,
- String? clientToken,
- AIGuardrailContentPolicyConfig? contentPolicyConfig,
- AIGuardrailContextualGroundingPolicyConfig? contextualGroundingPolicyConfig,
- String? description,
- AIGuardrailSensitiveInformationPolicyConfig? sensitiveInformationPolicyConfig,
- AIGuardrailTopicPolicyConfig? topicPolicyConfig,
- AIGuardrailWordPolicyConfig? wordPolicyConfig,
Updates an AI Guardrail.
May throw AccessDeniedException.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter aiGuardrailId :
The identifier of the Amazon Q in Connect AI Guardrail.
Parameter assistantId :
The identifier of the Amazon Q in Connect assistant. Can be either the ID
or the ARN. URLs cannot contain the ARN.
Parameter blockedInputMessaging :
The message to return when the AI Guardrail blocks a prompt.
Parameter blockedOutputsMessaging :
The message to return when the AI Guardrail blocks a model response.
Parameter visibilityStatus :
The visibility status of the Amazon Q in Connect AI Guardrail.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services SDK
populates this field. For more information about idempotency, see Making
retries safe with idempotent APIs..
Parameter contentPolicyConfig :
The content filter policies to configure for the AI Guardrail.
Parameter contextualGroundingPolicyConfig :
The contextual grounding policy configuration used to create an AI
Guardrail.
Parameter description :
A description of the AI Guardrail.
Parameter sensitiveInformationPolicyConfig :
The sensitive information policy to configure for the AI Guardrail.
Parameter topicPolicyConfig :
The topic policies to configure for the AI Guardrail.
Parameter wordPolicyConfig :
The word policy you configure for the AI Guardrail.
Implementation
Future<UpdateAIGuardrailResponse> updateAIGuardrail({
required String aiGuardrailId,
required String assistantId,
required String blockedInputMessaging,
required String blockedOutputsMessaging,
required VisibilityStatus visibilityStatus,
String? clientToken,
AIGuardrailContentPolicyConfig? contentPolicyConfig,
AIGuardrailContextualGroundingPolicyConfig? contextualGroundingPolicyConfig,
String? description,
AIGuardrailSensitiveInformationPolicyConfig?
sensitiveInformationPolicyConfig,
AIGuardrailTopicPolicyConfig? topicPolicyConfig,
AIGuardrailWordPolicyConfig? wordPolicyConfig,
}) async {
final $payload = <String, dynamic>{
'blockedInputMessaging': blockedInputMessaging,
'blockedOutputsMessaging': blockedOutputsMessaging,
'visibilityStatus': visibilityStatus.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (contentPolicyConfig != null)
'contentPolicyConfig': contentPolicyConfig,
if (contextualGroundingPolicyConfig != null)
'contextualGroundingPolicyConfig': contextualGroundingPolicyConfig,
if (description != null) 'description': description,
if (sensitiveInformationPolicyConfig != null)
'sensitiveInformationPolicyConfig': sensitiveInformationPolicyConfig,
if (topicPolicyConfig != null) 'topicPolicyConfig': topicPolicyConfig,
if (wordPolicyConfig != null) 'wordPolicyConfig': wordPolicyConfig,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/assistants/${Uri.encodeComponent(assistantId)}/aiguardrails/${Uri.encodeComponent(aiGuardrailId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateAIGuardrailResponse.fromJson(response);
}