feat: handle overloaded errors [LET-5969] (#5856)

feat: handle overloaded errors
This commit is contained in:
Sarah Wooders
2025-10-30 14:46:05 -07:00
committed by Caren Thomas
parent bd61ba85dd
commit d109bab587
3 changed files with 12 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ from letta.errors import (
LettaUserNotFoundError,
LLMAuthenticationError,
LLMError,
LLMProviderOverloaded,
LLMRateLimitError,
LLMTimeoutError,
PendingApprovalError,
@@ -398,6 +399,7 @@ def create_application() -> "FastAPI":
# 503 Service Unavailable errors
app.add_exception_handler(OperationalError, _error_handler_503)
app.add_exception_handler(LettaServiceUnavailableError, _error_handler_503)
app.add_exception_handler(LLMProviderOverloaded, _error_handler_503)
@app.exception_handler(IncompatibleAgentType)
async def handle_incompatible_agent_type(request: Request, exc: IncompatibleAgentType):