Skip to content
Columbia MSDS Dec 2026
Resume
All projects

Tool Calling · Sports Analytics

Cricket Analyst

Ask a cricket question and inspect the tools behind the answer. Gemini selects endpoints for player statistics, matchups, match analysis, and charts.

Public hosting is paused to keep cloud costs down. Explore the source and local setup guide; no live endpoint is linked. Men's ODI coverage is limited to imported Cricsheet matches.

  • Python
  • FastAPI
  • Gemini
  • LiteLLM
  • PostgreSQL
  • React
  • Apache ECharts
  • Cloud Run
  • Whisper
  • Kokoro

What I built

Every tool call exposes its arguments and structured result beside the answer.

  • Built a Gemini tool-calling loop with an allowlisted dispatcher for career statistics, player and match lookups, batter-bowler matchups, squad comparison, and wicket-response analysis.
  • Keep calculations in Python and SQL. Chart requests reuse datasets saved in the conversation rather than asking the model to invent values.
  • Added Apache ECharts visualizations, optional Whisper dictation, and Kokoro read-aloud workers. Deployed on Cloud Run; public hosting is currently paused.

How it works

  1. A question enters the FastAPI conversation endpoint.
  2. Gemini selects an advertised tool and structured arguments through LiteLLM.
  3. The dispatcher validates the tool name and calls the corresponding Python/SQL or data-source function.
  4. The UI displays the tool trace, answer, and saved-data chart specifications.

Evaluation & evidence

Inspect arguments and raw results in the UI, compare chart values with their saved dataset, and reproduce the sample queries in the repository. These are inspectability checks, not a reported answer-accuracy benchmark.

Scope & limitations

Coverage is men's ODI matches in the imported Cricsheet data. Tests and T20Is are outside this dataset, and voice workers can add latency.

Inspect the details

Discuss this project