updated skeleton with true data

This commit is contained in:
2025-12-09 08:40:18 +01:00
parent 61e6644158
commit 8cd91b6f22
27 changed files with 1193 additions and 14 deletions

21
gateway/api/voices.py Normal file
View File

@ -0,0 +1,21 @@
from fastapi import APIRouter
import json
from pathlib import Path
router = APIRouter()
REG = Path("voices/registry.json")
@router.post("/register")
async def register(data: dict):
reg = {}
if REG.exists():
reg = json.loads(REG.read_text())
reg[data["name"]] = data
REG.write_text(json.dumps(reg, indent=2))
return {"status": "ok", "voices": list(reg.keys())}
@router.get("/list")
async def list_voices():
if not REG.exists():
return []
return json.loads(REG.read_text())