remove lettaresponse spec hardcode and add references to pydantic

This commit is contained in:
Caren Thomas
2024-12-26 14:22:10 -08:00
parent 1fdfb181ac
commit 7141e5909d
2 changed files with 26 additions and 5 deletions

View File

@@ -68,9 +68,6 @@ def generate_openapi_schema(app: FastAPI):
openai_docs["info"]["title"] = "OpenAI Assistants API"
letta_docs["paths"] = {k: v for k, v in letta_docs["paths"].items() if not k.startswith("/openai")}
letta_docs["info"]["title"] = "Letta API"
letta_docs["components"]["schemas"]["LettaResponse"] = {
"properties": LettaResponse.model_json_schema(ref_template="#/components/schemas/LettaResponse/properties/{model}")["$defs"]
}
# Split the API docs into Letta API, and OpenAI Assistants compatible API
for name, docs in [