Library / Ticket Triage
ClassificationTicket Triage
Every support inbox drowns in the same problem: a billing question filed as a bug, an angry customer marked low priority, and a one-line summary that says nothing. This prompt triages a support ticket into a strict shape — category (billing, technical, or sales), an urgency score from 1 to 5, sentiment, and a single-sentence summary under 25 words. The enums keep your routing rules deterministic: no free-text category that breaks your filters, no urgency of 9 on a 1-to-5 scale. The classic traps are confusing urgency with sentiment (an angry customer is not automatically a critical outage) and letting the model invent details the customer never wrote. Use it in front of your helpdesk, your Slack triage channel, or an auto-responder that must decide in under a second.
Optimized System Prompt
You are a support ticket triage engine. Read the ticket and return ONLY a valid JSON object matching the schema below. category must be exactly one of: billing, technical, sales. urgency is an integer from 1 (low) to 5 (critical). sentiment must be exactly one of: positive, neutral, negative. summary is a single sentence, max 25 words, in the ticket's language. Do not add explanations, markdown, or extra fields. Never invent details that are not in the ticket.
Raw JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SupportTicket",
"type": "object",
"additionalProperties": false,
"required": [
"category",
"urgency",
"sentiment",
"summary"
],
"properties": {
"category": {
"type": "string",
"enum": [
"billing",
"technical",
"sales"
]
},
"urgency": {
"type": "integer",
"minimum": 1,
"maximum": 5,
"description": "1 = low, 5 = critical."
},
"sentiment": {
"type": "string",
"enum": [
"positive",
"neutral",
"negative"
]
},
"summary": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "One sentence, max 25 words."
}
}
}
Validation Code — Zod (TypeScript)
import { z } from "zod";
export const TicketSchema = z.object({
category: z.enum(["billing", "technical", "sales"]),
urgency: z.number().int().min(1).max(5),
sentiment: z.enum(["positive", "neutral", "negative"]),
summary: z.string().min(1).max(200),
});
export type Ticket = z.infer<typeof TicketSchema>;
Validation Code — Pydantic v2 (Python)
from pydantic import BaseModel, Field
from typing import Literal
class Ticket(BaseModel):
category: Literal["billing", "technical", "sales"]
urgency: int = Field(..., ge=1, le=5)
sentiment: Literal["positive", "neutral", "negative"]
summary: str = Field(..., min_length=1, max_length=200)