"""Generate an HTML proof page from a real routed call to the live HF Space.""" from __future__ import annotations import datetime import html import httpx BASE = "https://build-small-hackathon-hearthnet.hf.space" def call(cap: str, inp: dict) -> dict: r = httpx.post( f"{BASE}/bus/v1/call", json={"capability": cap, "version": "1.0", "input": inp}, timeout=90, follow_redirects=True, ) return r.json() def main() -> None: man = httpx.get(f"{BASE}/manifest", timeout=60, follow_redirects=True).json() chat = call("llm.chat", {"messages": [{"role": "user", "content": "In one sentence, how do I store water safely?"}]}) rag = call("rag.list_corpora", {}) node = man.get("node_id", "?") caps = [c.get("name") if isinstance(c, dict) else c for c in man.get("capabilities", [])] ans = chat["output"]["message"]["content"] model = chat["meta"]["model"] ms = chat["meta"]["ms"] corp = rag["output"]["corpora"] ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M") doc = f"""