"""Exceptions for the LLM gateway.""" from __future__ import annotations class GatewayError(Exception): """Base exception for LLM gateway errors.""" class BudgetExceeded(GatewayError): """Raised when a task would exceed its configured token budget. This is raised BEFORE any provider call is made. """ class SchemaValidationError(GatewayError): """Raised when the LLM output does not validate against the schema.""" class ProviderError(GatewayError): """Raised when a provider call fails after all retries and fallbacks."""