AnyGuardrail
Last updated
Factory class for creating guardrail instances.
Create a guardrail instance.
Parameters
guardrail_name
GuardrailName
Yes
—
The name of the guardrail to use.
provider
Optional[Provider[Any, Any]]
No
None
Optional provider instance to use for model loading and inference.
Returns: Guardrail
Return the static taxonomy/capability metadata for a guardrail.
Parameters
guardrail_name
GuardrailName
Yes
—
The guardrail to look up.
Returns: GuardrailMetadata
List guardrails whose metadata matches every supplied filter.
Filters combine with AND across dimensions. Set-valued dimensions (category, stage, output_shape) accept a single enum member or an iterable and match when the guardrail has any of the requested values. Scalar dimensions match by equality. A None filter is ignored. Runs entirely against the import-free registry — no backends are loaded.
Parameters
category
`GuardrailCategory
Iterable[GuardrailCategory]
None`
No
stage
`GuardrailStage
Iterable[GuardrailStage]
None`
No
output_shape
`OutputShape
Iterable[OutputShape]
None`
No
backend
`BackendType
None`
No
None
requires_api_key
`bool
None`
No
None
multilingual
`bool
None`
No
None
multimodal
`bool
None`
No
None
vendor
`str
None`
No
None
Returns: list[GuardrailName]
Group guardrails by one metadata dimension.
Parameters
dimension
str
Yes
—
One of "category", "stage", "output_shape", "backend", or "vendor". For set-valued dimensions a guardrail appears under every value it carries.
Returns: dict[str, list[GuardrailName]]
List all supported guardrails.
Returns: list[GuardrailName]
Get the model IDs supported by a specific guardrail.
Parameters
guardrail_name
GuardrailName
Yes
—
Returns: list[str]
Get all model IDs supported by all guardrails.
Returns: dict[str, list[str]]
Last updated