GuardRailCreateRequest¶
- pydantic model openapi_client.models.guard_rail_create_request.GuardRailCreateRequest¶
Request body for creating a new guard rail. Although only GuardRailName and Description are required here, at least one policy field must also be present - DeniedTopics, FiltersConfig, CustomWordFilters, SensitiveInformationFilters, EnableContextualGroundingCheck or AutomatedReasoningPolicies - because Bedrock rejects a guard rail carrying no policy. A body with none returns GE-1034 with the underlying Bedrock message Guardrail must have at least one policy.
- Fields:
- field guard_rail_name: StrictStr [Required] (alias 'GuardRailName')¶
The name of the guard rail.
- Constraints:
strict = True
- field description: StrictStr [Required] (alias 'Description')¶
The description of the guard rail.
- Constraints:
strict = True
- field blocked_message: Optional[StrictStr] = None (alias 'BlockedMessage')¶
The message to display when content is blocked.
- field filters_config: Optional[List[GuardRailFilterConfig]] = None (alias 'FiltersConfig')¶
Configuration for content filters.
- field denied_topics: Optional[List[DeniedTopic]] = None (alias 'DeniedTopics')¶
List of topics that are denied.
- field sensitive_information_filters: Optional[SensitiveInformationFilters] = None (alias 'SensitiveInformationFilters')¶
- field custom_word_filters: Optional[CustomWordFilters] = None (alias 'CustomWordFilters')¶
- field enable_contextual_grounding_check: Optional[StrictBool] = None (alias 'EnableContextualGroundingCheck')¶
Whether to enable contextual grounding check.
- field grounding_threshold: Optional[Union[StrictFloat, StrictInt]] = None (alias 'GroundingThreshold')¶
The threshold for grounding check.
- field relevance_threshold: Optional[Union[StrictFloat, StrictInt]] = None (alias 'RelevanceThreshold')¶
The threshold for relevance check.
- field tier: Optional[StrictStr] = None (alias 'Tier')¶
The tier of the guard rail (CLASSIC or STANDARD). Defaults to CLASSIC if not provided.
- field is_cross_region_enabled: Optional[StrictBool] = None (alias 'IsCrossRegionEnabled')¶
Whether to enable cross-region configuration for the guard rail. If true, adds guardrailProfileIdentifier. STANDARD tier requires this to be true.
- field scope: Optional[StrictStr] = None (alias 'Scope')¶
The scope of the guard rail (global or private). Defaults to private if not provided. Cannot be changed after creation.
- field automated_reasoning_policies: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = None (alias 'AutomatedReasoningPolicies')¶
Optional list of Automated Reasoning policy ARNs (max 2). Requires IsCrossRegionEnabled to be true.
- field policies_confidence_threshold: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = None (alias 'PoliciesConfidenceThreshold')¶
Confidence threshold for Automated Reasoning policies (0-1). Only valid when AutomatedReasoningPolicies is provided.
- to_str()¶
Returns the string representation of the model using alias
- Return type:
str
- to_json()¶
Returns the JSON representation of the model using alias
- Return type:
str
- classmethod from_json(json_str)¶
Create an instance of GuardRailCreateRequest from a JSON string
- Return type:
Optional[Self]
- to_dict()¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
Dict[str,Any]
- classmethod from_dict(obj)¶
Create an instance of GuardRailCreateRequest from a dict
- Return type:
Optional[Self]