Skip to content

About

Classify support tickets in BigQuery with Jev and Cloud Run

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Jev + BigQuery + Cloud Run

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.

BigQuery sends ticket batches to a private Cloud Run adapter, which sends state and questions to the TypeSafe Jev API. Typed answers return through the adapter as one JSON result per ticket.

Run

You need a Google Cloud project with billing, gcloud and bq, and a TypeSafe API key.

  1. Follow setup to deploy the adapter and register the function.

  2. 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.

Files

Behavior

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.

Tests

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

About

Classify support tickets in BigQuery with Jev and Cloud Run

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages