Fact & Hallucination Intelligence Engine
Real-time claim verification across Twitter/X, Instagram, YouTube, and AI chat interfaces. Powered by Groq · BGE-M3 · Qdrant · Memgraph.
""" app_demo.py — Hugging Face Spaces interactive demo. A standalone FastAPI app that provides: 1. The production WebSocket backend (from main.py) 2. A beautiful HTML/JS demo dashboard at /demo — Live claim submission with animated results — WebSocket connection indicator — Color-coded verdict cards with confidence arcs — No browser extension required to test Mount order: /demo static HTML, /ws WebSocket, all other routes from main.py """ from __future__ import annotations import os from fastapi import FastAPI from fastapi.responses import HTMLResponse from fastapi.middleware.cors import CORSMiddleware # Re-export the main app with the demo page bolted on from main import app as fact_app # Inject the demo route @fact_app.get("/demo", response_class=HTMLResponse, include_in_schema=False) async def demo_page(): return HTMLResponse(DEMO_HTML) @fact_app.get("/favicon.ico", include_in_schema=False) async def favicon(): from fastapi.responses import Response # 1x1 transparent gif return Response( content=b"GIF89a\x01\x00\x01\x00\x00\xff\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x00;", media_type="image/gif", ) DEMO_HTML = r"""
Real-time claim verification across Twitter/X, Instagram, YouTube, and AI chat interfaces. Powered by Groq · BGE-M3 · Qdrant · Memgraph.