feat: enable optimized json response parsing (#8436)

This commit is contained in:
cthomas
2026-01-08 12:31:31 -08:00
committed by Caren Thomas
parent 8adb88e7ea
commit b8e7c14f16

View File

@@ -18,7 +18,7 @@ faulthandler.enable()
from fastapi import FastAPI, Request
from fastapi.exceptions import RequestValidationError
from fastapi.responses import JSONResponse
from fastapi.responses import JSONResponse, ORJSONResponse
from marshmallow import ValidationError
from sqlalchemy.exc import IntegrityError, OperationalError
from starlette.middleware.cors import CORSMiddleware
@@ -338,6 +338,7 @@ def create_application() -> "FastAPI":
version=letta_version,
debug=debug_mode, # if True, the stack trace will be printed in the response
lifespan=lifespan,
default_response_class=ORJSONResponse, # Use orjson for 10x faster JSON serialization
)
# === Global Exception Handlers ===