diff --git a/pyproject.toml b/pyproject.toml index 426d530..b065d7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "core-api" -version = "1.3.1" +version = "1.3.2" description = "Core Code API - Infrastructure management and tools API" readme = "README.md" requires-python = ">=3.12" diff --git a/src/controllers/health_controller.py b/src/controllers/health_controller.py index 5491b46..e9299b4 100644 --- a/src/controllers/health_controller.py +++ b/src/controllers/health_controller.py @@ -52,20 +52,7 @@ class HealthController(BaseController): "service": settings.app_name, "version": settings.app_version, "status": "healthy", - "documentation": { - "swagger_ui": "/docs", - "redoc": "/redoc", - "openapi_spec": "/openapi.json" - }, - "endpoints": { - "chat_completions": "/v1/chat/completions", - "models": "/v1/models", - "conversations": "/v1/conversations", - "dns_lookup": "/tools/dns/lookup", - "infrastructure": "/infrastructure", - "health": "/health", - "health_full": "/health/full" - } + "docs": "/docs" } @router.get( diff --git a/src/main.py b/src/main.py index 350ca06..19a82f1 100644 --- a/src/main.py +++ b/src/main.py @@ -64,89 +64,18 @@ app = FastAPI( title=settings.app_name, version=settings.app_version, description=""" - Core Code API provides OpenAPI-compatible functions and AI orchestration for Open WebUI. +Core Code API - Infrastructure management and home automation API. - ## Features +## Features - ### OpenAI-Compatible API (v1) - - `/v1/chat/completions` - Chat completions with streaming support - - `/v1/models` - List available models - Compatible with OpenAI client libraries and Open WebUI. +- **Infrastructure Management** - Container and stack management via Portainer +- **Home Automation** - Device control via Home Assistant +- **Tools** - DNS lookup and utilities - ### Conversation Memory (Phase 2) - - `/v1/conversations/{id}` - Get conversation history - - `/v1/conversations/{id}/search` - Semantic search within conversation - - `/v1/conversations/search` - Search across all conversations - - `/v1/conversations/{id}/stats` - Get conversation statistics - - `/v1/conversations/{id}/consolidate` - Manual consolidation - - `DELETE /v1/conversations/{id}` - Delete conversation - - Multi-tier memory system: - - **Tier 1**: Fast in-memory buffer (last 10 turns) - - **Tier 2/3**: Unified Qdrant storage (persistent + semantic search) - - ### Infrastructure Management - **Read Endpoints:** - - `GET /infrastructure/health` - Check Portainer & NPM connectivity - - `GET /infrastructure/services` - List all deployed services - - `GET /infrastructure/services/{name}` - Get service details - - `GET /infrastructure/ports` - List allocated ports - - `GET /infrastructure/domains` - List configured domains - - **Write Endpoints (Admin Only):** - - `POST /infrastructure/services` - Deploy new service from compose YAML - - `PUT /infrastructure/services/{name}` - Update existing service - - `DELETE /infrastructure/services/{name}` - Remove service and stack - - `POST /infrastructure/proxy` - Create proxy host with optional SSL - - Automates infrastructure operations via Portainer and Nginx Proxy Manager APIs. - - ### Home Automation (Housekeeping) - **Read Endpoints:** - - `GET /housekeeping/health` - Check Home Assistant connectivity - - `GET /housekeeping/devices` - List devices (filter by domain, area) - - `GET /housekeeping/devices/{entity_id}` - Get device details - - `GET /housekeeping/areas` - List areas/rooms - - `GET /housekeeping/scenes` - List scenes - - `GET /housekeeping/scripts` - List scripts - - `GET /housekeeping/automations` - List automations - - `GET /housekeeping/history` - Get state history - - **Write Endpoints (Admin Only):** - - `POST /housekeeping/devices/{entity_id}/control` - Control device - - `POST /housekeeping/scenes/{scene_id}/activate` - Activate scene - - `POST /housekeeping/scripts/{script_id}/run` - Run script - - `POST /housekeeping/automations/{automation_id}/toggle` - Enable/disable automation - - Abstracts Home Assistant for the Tatlock Housekeeper agent and other consumers. - - ### Web Scraper - Intelligent web scraping with main content extraction. - Perfect for extracting articles, documentation, and blog posts for LLM consumption. - - ## Authentication - - When OIDC authentication is enabled (oidc_enabled=true in config): - - Infrastructure write endpoints require authentication - - Use OAuth2/OIDC bearer token from Authentik - - Admin group membership required for infrastructure operations - - ## Integration - - This API is designed to integrate with: - - **Open WebUI**: Direct OpenAI API compatibility - - **Open WebUI Functions**: Import via OpenAPI spec - - **Open WebUI Pipelines**: Use as data source - - **LangChain**: Compatible with standard HTTP tools - - ## Documentation - - - **OpenAPI Spec**: `/openapi.json` - - **Swagger UI**: `/docs` - - **ReDoc**: `/redoc` +See `/docs` for the full API reference. """, docs_url="/docs", - redoc_url="/redoc", + redoc_url=None, openapi_url="/openapi.json", lifespan=lifespan, debug=settings.debug, diff --git a/wakeup.sh b/wakeup.sh old mode 100644 new mode 100755