update_guardrail
¶
update_guardrail(
guardrail_identifier: GuardrailIdentifier,
name: GuardrailName,
blocked_input_messaging: GuardrailBlockedMessaging,
blocked_outputs_messaging: GuardrailBlockedMessaging,
*,
config_overrides: Optional[BedrockClientConfig] = 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/bedrock.py
4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 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 | |