Download apps/api/smoke.py from Sandy-sys/finai: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/spaces/Sandy-sys/finai/resolve/main/apps/api/smoke.py
- Command line
-
hf download hf://spaces/Sandy-sys/finai/apps/api/smoke.py
-
curl -L -o smoke.py https://huggingface.co/spaces/Sandy-sys/finai/resolve/main/apps/api/smoke.py
555 Bytes
| from fastapi.testclient import TestClient | |
| from mbf.app import app | |
| c = TestClient(app) | |
| for q in [ | |
| "Top 5 funders by FY26 actual spend", | |
| "Show me monthly burn for FY26", | |
| "Top spend categories", | |
| "Open POs by vendor", | |
| "Give me an overview", | |
| ]: | |
| r = c.post("/ask", json={"question": q}).json() | |
| p = r["plan"] | |
| print(f"Q={q!r}") | |
| print(f" mode={r['mode']} comps={len(p['components'])} " | |
| f"types={[x['type'] for x in p['components']]}") | |
| print(f" narrative={p['narrative'][:140]}") | |
| print() | |