Spaces:
Runtime error
Runtime error
File size: 909 Bytes
9301e20 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | """Dev-only launcher: runs the real app with a deterministic FakeLLM injected, so the full UI
flow can be exercised in a browser WITHOUT a Gemini API key.
This is test scaffolding, NOT part of the shipped application (the app always wires the real
Gemini client). Run it with:
uv run python tests/dev_server.py # serves http://127.0.0.1:8765
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
import uvicorn
from app.deps import get_llm, get_session_manager
from app.main import app
from app.services.session import SessionManager
from tests.fakes import FakeLLM
_fake = FakeLLM(token_count=5000)
_sessions = SessionManager()
app.dependency_overrides[get_llm] = lambda: _fake
app.dependency_overrides[get_session_manager] = lambda: _sessions
if __name__ == "__main__":
uvicorn.run(app, host="127.0.0.1", port=8765, log_level="warning")
|