Skip to content

innomatrix/support-ticket-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Support Ticket Classifier

An LLM-powered support-ticket classifier paired with a zero-dependency mock API that serves and validates tickets. The classifier pulls a random ticket, asks an LLM (served via OpenRouter) to label it with one of the ticket types the API advertises, then validates that label back against the API.

┌──────────────┐   GET /messages/random    ┌──────────────────┐
│              │ ─────────────────────────▶│                  │
│  classifier  │   GET /messages/types     │   mock API       │
│  (LLM call)  │ ─────────────────────────▶│   (stdlib only)  │
│              │   POST /messages/{id}/     │                  │
│              │ ────────── validate ──────▶│                  │
└──────────────┘                            └──────────────────┘

Layout

Path Description
api/app.py Mock HTTP API (Python standard library, no deps).
api/messages.json Seed dataset of SaaS support tickets across 5 types.
api/tests.py Tests for the API.
api/README.md API endpoint reference.
classification/classifier.py Fetches a ticket, classifies it via an LLM, validates it.

Prerequisites

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install requests openai python-dotenv

Create classification/.env with your key (this file is git-ignored):

API_KEY=sk-or-...

Run

Start the API in one terminal:

cd api
python3 app.py        # listens on http://localhost:5555

Run the classifier in another:

cd classification
python3 classifier.py

It logs the fetched ticket, the LLM's classification, and the API's validation verdict (including the expected type when the guess is wrong).

API endpoints

See api/README.md for the full reference. In short:

  • GET /messages — all messages (id, type)
  • GET /messages/types — distinct ticket types
  • GET /messages/random — one random full message
  • POST /messages/{id}/validate — check a type guess; returns {"valid": bool, ...}

About

LLM-powered support ticket classifier with a zero-dependency mock API for serving and validating tickets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages