guardrails_ai.sdk.methods¶
Functions¶
|
Delete a Guard via the API. |
|
Fetch a Guard by id from the API. |
|
Fetch a Guard by id from the API. |
|
Create a Guard via the API. |
|
Submit content to a Guard for validation. |
|
Update a Guard via the API. |
Module Contents¶
- async guardrails_ai.sdk.methods.delete_guard(*, client: httpx.AsyncClient, id: str) Any¶
Delete a Guard via the API.
- Parameters:
client – The async HTTP client to use for the request.
id – The unique id of the Guard to be deleted.
- Returns:
The raw JSON response parsed as a Python object.
- Raises:
httpx.HTTPStatusError – If the server returns a 4xx or 5xx response.
- async guardrails_ai.sdk.methods.get_guard(*, client: httpx.AsyncClient, id: str) Any¶
Fetch a Guard by id from the API.
- Parameters:
client – The async HTTP client to use for the request.
id – The id of the Guard to retrieve.
- Returns:
The raw JSON response parsed as a Python object.
- Raises:
httpx.HTTPStatusError – If the server returns a 4xx or 5xx response.
- async guardrails_ai.sdk.methods.get_guards(*, client: httpx.AsyncClient, name: str | None = None) Any¶
Fetch a Guard by id from the API.
- Parameters:
client – The async HTTP client to use for the request.
id – The id of the Guard to retrieve.
- Returns:
The raw JSON response parsed as a Python object.
- Raises:
httpx.HTTPStatusError – If the server returns a 4xx or 5xx response.
- async guardrails_ai.sdk.methods.post_guard(*, client: httpx.AsyncClient, body: dict[str, Any]) Any¶
Create a Guard via the API.
- Parameters:
client – The async HTTP client to use for the request.
body – The request body to create a Guard.
- Returns:
The raw JSON response parsed as a Python object.
- Raises:
httpx.HTTPStatusError – If the server returns a 4xx or 5xx response.
- async guardrails_ai.sdk.methods.post_guard_validate(*, client: httpx.AsyncClient, id: str, body: dict[str, Any]) Any¶
Submit content to a Guard for validation.
- Parameters:
client – The async HTTP client to use for the request.
id – The unique id of the Guard to validate against.
body – The request body, including
llm_outputand any additional fields.
- Returns:
The raw JSON response parsed as a Python object.
- Raises:
httpx.HTTPStatusError – If the server returns a 4xx or 5xx response.
- async guardrails_ai.sdk.methods.put_guard(*, client: httpx.AsyncClient, id: str, body: dict[str, Any]) Any¶
Update a Guard via the API.
- Parameters:
client – The async HTTP client to use for the request.
id – The unique id of the Guard to be updated.
body – The updated Guard definition.
- Returns:
The raw JSON response parsed as a Python object.
- Raises:
httpx.HTTPStatusError – If the server returns a 4xx or 5xx response.