feat: Implement streaming chat completions endpoint [LET-5485] (#5446)
* wip * Add chat completions router and fix streaming service * Finish chat completions * Finish chat completions * Remove extra print statement * Run just api * Don't explicitly throw http exceptions but surface Letta errors * Remap errors * Trigger CI * Add missing Optional import
This commit is contained in:
committed by
Caren Thomas
parent
714978f5ee
commit
2dae4d33c3
@@ -142,6 +142,14 @@ class LettaMCPTimeoutError(LettaMCPError):
|
||||
super().__init__(message=message, code=ErrorCode.TIMEOUT, details=details)
|
||||
|
||||
|
||||
class LettaServiceUnavailableError(LettaError):
|
||||
"""Error raised when a required service is unavailable."""
|
||||
|
||||
def __init__(self, message: str, service_name: Optional[str] = None):
|
||||
details = {"service_name": service_name} if service_name else {}
|
||||
super().__init__(message=message, code=ErrorCode.INTERNAL_SERVER_ERROR, details=details)
|
||||
|
||||
|
||||
class LettaUnexpectedStreamCancellationError(LettaError):
|
||||
"""Error raised when a streaming request is terminated unexpectedly."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user