fix: run openapi polyfill (#1937)

This commit is contained in:
cthomas 2025-04-29 16:41:01 -07:00 committed by GitHub
parent cad8232a14
commit b2e7e236f2

View File

@ -70,6 +70,9 @@ def generate_openapi_schema(app: FastAPI):
letta_docs["components"]["schemas"]["LettaAssistantMessageContentUnion"] = create_letta_assistant_message_content_union_schema()
letta_docs["components"]["schemas"]["LettaUserMessageContentUnion"] = create_letta_user_message_content_union_schema()
# Update the app's schema with our modified version
app.openapi_schema = letta_docs
for name, docs in [
(
"letta",
@ -303,6 +306,9 @@ def create_application() -> "FastAPI":
# / static files
mount_static_files(app)
# Generate OpenAPI schema after all routes are mounted
generate_openapi_schema(app)
@app.on_event("shutdown")
def on_shutdown():
global server