2026-06-12 01:58:46 +02:00
|
|
|
# retoor <retoor@molodetz.nl>
|
|
|
|
|
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
import logging
|
|
|
|
|
from fastapi import APIRouter, Request, HTTPException
|
|
|
|
|
from devplacepy.services.manager import service_manager
|
|
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _service():
|
|
|
|
|
svc = service_manager.get_service("openai")
|
|
|
|
|
if svc is None:
|
|
|
|
|
raise HTTPException(status_code=503, detail="Gateway is not available")
|
|
|
|
|
return svc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.post("/v1/chat/completions")
|
|
|
|
|
async def chat_completions(request: Request):
|
|
|
|
|
return await _service().handle(request, "chat/completions")
|
|
|
|
|
|
|
|
|
|
|
2026-06-14 03:06:18 +02:00
|
|
|
@router.post("/v1/embeddings")
|
|
|
|
|
async def embeddings(request: Request):
|
|
|
|
|
return await _service().handle(request, "embeddings")
|
|
|
|
|
|
|
|
|
|
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
@router.api_route("/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH"])
|
|
|
|
|
async def passthrough(request: Request, path: str):
|
|
|
|
|
return await _service().handle(request, path)
|