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
4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 | |