Classify 30 fictional support tickets by owning team, urgency, and blocked workflow. A private Cloud Run adapter calls TypeSafe's Jev API; a BigQuery remote function saves the answers for ordinary SQL queries.
You need a Google Cloud project with billing, gcloud and bq, and a
TypeSafe API key.
-
Follow setup to deploy the adapter and register the function.
-
Score the tickets once, then query the saved results:
export PROJECT_ID='YOUR_PROJECT_ID' bq query --project_id="$PROJECT_ID" --location=US \ --use_legacy_sql=false --use_cache=false < sql/03_score_tickets.sql bq query --project_id="$PROJECT_ID" --location=US \ --use_legacy_sql=false < sql/04_examples.sql
Scoring replaces the demo snapshot and incurs inference charges. The queries in
04_examples.sql make no further Jev calls; BigQuery compute still applies.
- support.py: category definitions, question wording, and adapter.
- 01_create_tickets.sql: all 30 tickets; edit these directly.
- 02_create_functions.sql: remote-function definition.
- 03_score_tickets.sql: saved scores and
enriched_ticketsview. - 04_examples.sql: team summary and urgent/blocked tickets, plus optional review-queue and resolution checks.
- two-tickets.json: direct Cloud Run test request.
POST /tickets takes {"tickets": [...]} and returns results.
POST /bigquery-tickets takes {"calls": [[ticket], ...]} and returns ordered
replies. Each result includes the team, route confidence, urgency and blocking
probabilities, model, and rubric version. Closed tickets also get a resolution
support score; a missing resolution gets zero by rule, and non-closed tickets
get null for that field.
Urgency and blocking describe the situation at submission. The 0.80 query cutoffs are examples, not validated operating thresholds. Model results can vary. The adapter accepts up to 10 tickets per request; the remote function defaults to 5. It validates inputs and outputs, splits oversized batches, and reports transient upstream failures as retryable errors. Logs omit ticket text and keys.
Python 3.12; no API key or cloud access needed:
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m unittest discover -s tests -v