feat(06-03): add AI sync backend — heuristic mapper, LLM generator, API endpoint
- Create lightsync/api/sync.py with POST /api/sync/generate and GET /api/sync/llm-available - heuristic_generate: intensity-to-animation mapping, chroma-to-color, beat-snapped block placement - llm_generate: Anthropic claude-3-haiku with lazy init, JSON parse + validation - section_range filtering for per-section generation (D-11) - Register sync.router with prefix /api/sync in main.py
This commit is contained in:
@@ -44,12 +44,13 @@ def create_app() -> FastAPI:
|
||||
app = FastAPI(title="LightSync", lifespan=lifespan, redirect_slashes=False)
|
||||
|
||||
# API routes (registered before static mount — see Pattern 7)
|
||||
from lightsync.api import shows, devices, ws, audio, timeline
|
||||
from lightsync.api import shows, devices, ws, audio, timeline, sync
|
||||
app.include_router(shows.router, prefix="/api/shows")
|
||||
app.include_router(devices.router, prefix="/api/devices")
|
||||
app.include_router(ws.router)
|
||||
app.include_router(audio.router, prefix="/api/audio")
|
||||
app.include_router(timeline.router, prefix="/api")
|
||||
app.include_router(sync.router, prefix="/api/sync")
|
||||
|
||||
# Serve uploaded audio files so <audio src=...> can load them
|
||||
shows_dir = Path("/app/shows")
|
||||
|
||||
Reference in New Issue
Block a user