update_guardrail
async
¶
update_guardrail(
guardrail_identifier: GuardrailIdentifier,
name: GuardrailName,
blocked_input_messaging: GuardrailBlockedMessaging,
blocked_outputs_messaging: GuardrailBlockedMessaging,
*,
config_overrides: Optional[AsyncBedrockClientConfig] = None,
description: Optional[GuardrailDescription] = None,
topic_policy_config: Optional[GuardrailTopicPolicyConfig] = None,
content_policy_config: Optional[GuardrailContentPolicyConfig] = None,
word_policy_config: Optional[GuardrailWordPolicyConfig] = None,
sensitive_information_policy_config: Optional[
GuardrailSensitiveInformationPolicyConfig
] = None,
contextual_grounding_policy_config: Optional[
GuardrailContextualGroundingPolicyConfig
] = None,
automated_reasoning_policy_config: Optional[
GuardrailAutomatedReasoningPolicyConfig
] = None,
cross_region_config: Optional[GuardrailCrossRegionConfig] = None,
kms_key_id: Optional[KmsKeyId] = None,
) -> UpdateGuardrailResponse
Updates a guardrail with the values you specify.
-
Specify a
nameand optionaldescription. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessagingandblockedOutputsMessagingfields. -
Specify topics for the guardrail to deny in the
topicPolicyConfigobject. Each GuardrailTopicConfig object in thetopicsConfiglist pertains to one topic.-
Give a
nameanddescriptionso that the guardrail can properly identify the topic. -
Specify
DENYin thetypefield. -
(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the
exampleslist.
-
-
Specify filter strengths for the harmful categories defined in Amazon Bedrock in the
contentPolicyConfigobject. Each GuardrailContentFilterConfig object in thefiltersConfiglist pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig.-
Specify the category in the
typefield. -
Specify the strength of the filter for prompts in the
inputStrengthfield and for model responses in thestrengthfield of the GuardrailContentFilterConfig.
-
-
(Optional) For security, include the ARN of a KMS key in the
kmsKeyIdfield.
Parameters:
-
guardrail_identifier(GuardrailIdentifier) –The unique identifier of the guardrail. This can be an ID or the ARN.
-
name(GuardrailName) –A name for the guardrail.
-
description(Optional[GuardrailDescription], default:None) –A description of the guardrail.
-
topic_policy_config(Optional[GuardrailTopicPolicyConfig], default:None) –The topic policy to configure for the guardrail.
-
content_policy_config(Optional[GuardrailContentPolicyConfig], default:None) –The content policy to configure for the guardrail.
-
word_policy_config(Optional[GuardrailWordPolicyConfig], default:None) –The word policy to configure for the guardrail.
-
sensitive_information_policy_config(Optional[GuardrailSensitiveInformationPolicyConfig], default:None) –The sensitive information policy to configure for the guardrail.
-
contextual_grounding_policy_config(Optional[GuardrailContextualGroundingPolicyConfig], default:None) –The contextual grounding policy configuration used to update a guardrail.
-
automated_reasoning_policy_config(Optional[GuardrailAutomatedReasoningPolicyConfig], default:None) –Updated configuration for Automated Reasoning policies associated with the guardrail.
-
cross_region_config(Optional[GuardrailCrossRegionConfig], default:None) –The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed.
For more information, see the Amazon Bedrock User Guide.
-
blocked_input_messaging(GuardrailBlockedMessaging) –The message to return when the guardrail blocks a prompt.
-
blocked_outputs_messaging(GuardrailBlockedMessaging) –The message to return when the guardrail blocks a model response.
-
kms_key_id(Optional[KmsKeyId], default:None) –The ARN of the KMS key with which to encrypt the guardrail.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–Error occurred because of a conflict while performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock/_services/async_bedrock.py
5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 | |