Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: add health check route
Shubham Naik188c3dd942fc
diff --git a/letta/schemas/health.py b/letta/schemas/health.pynew file mode 100644index 000000000..08bfcee48--- /dev/null+++ b/letta/schemas/health.py@@ -0,0 +1,8 @@+from pydantic import BaseModel++class Health(BaseModel):+ """+ Health check response body+ """+ version: str+ status: str\ No newline at end of filediff --git a/letta/server/rest_api/routers/v1/__init__.py b/letta/server/rest_api/routers/v1/__init__.pyindex d6e0bdae1..8582b5ba5 100644--- a/letta/server/rest_api/routers/v1/__init__.py+++ b/letta/server/rest_api/routers/v1/__init__.py@@ -4,6 +4,7 @@ from letta.server.rest_api.routers.v1.jobs import router as jobs_routerfrom letta.server.rest_api.routers.v1.llms import router as llm_routerfrom letta.server.rest_api.routers.v1.sources import router as sources_routerfrom letta.server.rest_api.routers.v1.tools import router as tools_router+from letta.server.rest_api.routers.v1.health import router as health_routerROUTERS = [tools_router,@@ -12,4 +13,5 @@ ROUTERS = [llm_router,blocks_router,jobs_router,+ health_router,]diff --git a/letta/server/rest_api/routers/v1/health.py b/letta/server/rest_api/routers/v1/health.pynew file mode 100644index 000000000..28d8f317d--- /dev/null+++ b/letta/server/rest_api/routers/v1/health.py@@ -0,0 +1,21 @@+from typing import TYPE_CHECKING, List, Optional++from fastapi import APIRouter, Body, Depends, HTTPException, Query++from letta.cli.cli import version+from letta.schemas.health import Health+from letta.server.rest_api.utils import get_letta_server+from letta.server.server import SyncServer++if TYPE_CHECKING:+ pass++router = APIRouter(prefix="/health", tags=["health"])++# Health check[email protected]("/", response_model=Health, operation_id="health_check")+def health_check():+ return Health(+ version=version(),+ status="ok",+ )