Pipe17 Ops Agent — Gemini Function‑Calling Demo
Single‑file project you can deploy on GitHub Pages. Paste a Gemini API key (web key with referrer restriction) and chat with an agent that can query mock Pipe17 data via tools (function calls) — orders, inventory, and ticketing.
How this Agent Works
- Goal: Simulate a Pipe17 ops copilot that can check orders & inventory and open tickets.
- Model: Google Gemini (
1.5‑flash
by default) called from the browser via the Web SDK.
- Tools: We define functions with JSON schemas. Gemini decides when to call them.
- Loop: The app executes tool calls, returns results to Gemini, and streams the final answer.
- Data: Mock datasets are embedded below (so the whole thing is one file).
- Security: Use an AI Studio web API key restricted to your GitHub Pages domain referrer.
Deploy on GitHub Pages
- Create a new repo → add this
index.html
.
- Settings → Pages → Deploy from main / root.
- In AI Studio, create an API key → Restrict to your Pages URL (e.g.,
https://<user>.github.io/<repo>/
).
- Open your Pages URL → paste the key → Save → start chatting.
Optional: Store the key in localStorage
(this UI does) or pass via ?key=YOUR_KEY
in the URL during a private demo.