Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: run openapi polyfill (#1937)

cthomas7fb6d683805e
diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py
index c5dc3be7c..5aeb206c3 100644
--- a/letta/server/rest_api/app.py
+++ b/letta/server/rest_api/app.py
@@ -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