face8023a4
- api.js: API bridge to FastAPI backend - Dynamic NPC dialogues via gemma4:12b (cached 30s) - Periodic world event generation (every ~10s) - Event validation (no soft-lock) - Backend health check on startup - Fallback to static dialogue if LLM offline - Tested: events ✅, dialogues ✅
Aether Chronicles — Backend
FastAPI server for LLM integration, game state persistence, and world event generation.
Setup
python3 -m venv venv
source venv/bin/activate
pip install fastapi uvicorn ollama
uvicorn main:app --reload --port 8000
Endpoints
GET /api/player— Get player statePOST /api/player/move— Update player positionGET /api/events/{map_id}— Get active events for a mapPOST /api/llm/event— Generate a new event via LLMPOST /api/llm/dialogue— Generate NPC dialogue via LLM