nemoguardrails.exceptions
Module Contents
Classes
API
Bases: ValueError
Base class for Guardrails Configuration validation errors.
Bases: ValueError
Raised when a check’s arguments contradict each other, such as tools without a tool_call check.
Bases: ConfigurationError
Raised when a guardrail configuration’s model is invalid.
Bases: ValueError
Raised when a caller-supplied state argument is not valid public input.
The serialized Colang 2.0 runtime State carries trusted control-plane fields
(flow_configs, rails_config, in-flight flow execution) and must not come
from an untrusted caller. Stateful 2.x execution uses process_events_async,
which keeps a live State object in the trusted Python process.
Bases: LLMClientError
Bases: LLMClientError
Bases: Exception
A wrapper around the LLM call invocation exception.
This is used to propagate the exception out of the generate_async call.
When the inner exception carries an HTTP status code (e.g. a
LLMClientError), callers can inspect status to decide
which HTTP response code to return to the upstream client.
Bases: Exception
Base class for LLM client errors.
status_code holds the HTTP response status when one was received,
or 0 when no response arrived (client-side timeout or network
error). Callers should branch on exception class rather than
status_code to distinguish HTTP vs network failures, the type
hierarchy is the authoritative discriminator.
Bases: LLMClientError
Bases: LLMBadRequestError
Bases: LLMClientError
Bases: LLMClientError
Bases: LLMClientError
Bases: LLMClientError
Bases: LLMBadRequestError
Bases: QueueFull
Raised when the IORails non-streaming admission queue cannot accept more work.
Subclasses asyncio.QueueFull because that is what the underlying
work queue raises, so callers already catching it keep working.
Bases: InvalidRailsConfigurationError
Raised when an explicitly requested rail type has no configured flows.
Bases: InvalidRailsConfigurationError
Raised when an explicitly requested rail type cannot run on the serving engine.
Bases: Exception
Raised when IORails has no free streaming slot for a new request.
The streaming path is bounded by an asyncio.Semaphore rather than
a queue, so this deliberately does not subclass asyncio.QueueFull:
nothing is queued and nothing is full. It is a distinct overload condition
from NonStreamingWorkQueueFullError and carries its own client-facing
message.
Bases: InvalidRailsConfigurationError
Raised when streaming is requested but not supported by the configuration.
Bases: ValueError
Raised when a rendered tool conversation exceeds the general prompt limit.
Tool exchanges are rejected intact rather than truncated, which could orphan calls or discard the results needed to answer the user. Lengths are measured in serialized characters, with structured inline image payloads discounted.