AnyGuardrail
AnyGuardrail
any_guardrail.api.AnyGuardrail
Factory class for creating guardrail instances.
Source code in src/any_guardrail/api.py
create(guardrail_name, provider=None, **kwargs)
classmethod
Create a guardrail instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
guardrail_name
|
GuardrailName
|
The name of the guardrail to use. |
required |
provider
|
Provider[Any, Any] | None
|
Optional provider instance to use for model loading and inference. |
None
|
**kwargs
|
Any
|
Additional keyword arguments to pass to the guardrail constructor. |
{}
|
Returns:
| Type | Description |
|---|---|
Guardrail[Any, Any, Any]
|
A guardrail instance. |
Source code in src/any_guardrail/api.py
get_all_supported_models()
classmethod
Get all model IDs supported by all guardrails.
Source code in src/any_guardrail/api.py
get_supported_guardrails()
classmethod
get_supported_model(guardrail_name)
classmethod
Get the model IDs supported by a specific guardrail.