Foundation (phase 01, verified): - FastAPI app: /api/health, /api/suggestions, /api/chat (placeholder), static frontend served locally (no CDN) - Postgres 17 + pgvector via db/Containerfile + compose.yaml (podman compose up -d db), Alembic initial migration (documents, chunks with vector(768), query_log) - LLM client targeting https://aipi.reeseapps.com/v1 (turbo/embed); scripts/llm_probe.py verified models + 768-dim embeddings live - Conditional debugpy: imported only when DEBUGPY=1 (attach on demand, :5678); logging config for clean single-line logs - Frontend shell: mobile-first chat + Sources pages, tokens, a11y baselines - Tests: 24 unit+integration (99% coverage on app/), ruff + pyright clean, Playwright smoke E2E (3 tests) against a deterministic mock LLM - Planning: .agent/PLAN.md (architecture + LOCKED decisions), AGENTS.md, 6 user stories, 7 phase files (one story / one phase / one Playwright suite each)
30 lines
871 B
Python
30 lines
871 B
Python
"""POST /api/chat — placeholder (phase 01).
|
|
|
|
Phase 03 replaces this with the real RAG pipeline and SSE streaming
|
|
(PLAN §4 contract: ``delta`` events + final ``done``). The placeholder
|
|
keeps the same JSON shape the frontend already consumes, so the UI round-trip
|
|
is exercised end-to-end from day one.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from app.schemas import ChatRequest
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.post("/chat")
|
|
async def chat(request: ChatRequest) -> dict[str, object]:
|
|
"""Placeholder answer — no LLM, no DB."""
|
|
return {
|
|
"ok": True,
|
|
"answer": (
|
|
"Hey! My neurons are still wiring up — the real Brain "
|
|
"(RAG over your docs, powered by aipi) lands in the next "
|
|
"phases. Try me again soon! 🧠"
|
|
),
|
|
"deflected": False,
|
|
"sources": [],
|
|
}
|