Provides a lightweight client for LeanCtx API endpoints with health and capabilities checks.
# Source: https://github.com/yvgude/lean-ctx | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations
from types import TracebackType
from typing import Any
import httpx
from leanctx.types import HealthResponse
class LeanCtxClient:
def __init__(self, base_url: str = "http://localhost:3333"):
self._base_url = base_url.rstrip("/")
self._client = httpx.Client(base_url=self._base_url, timeout=30.0)
def health(self) -> HealthResponse:
data = self._get_json("/ocla/v1/health")
return HealthResponse(status=data["status"], version=data["version"])
def capabilities(self) -> dict[str, Any]:
return self._get_j
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key