JSON schema: classify a support ticket
JSON Schema to classify a support ticket: category, priority, sentiment, one-sentence summary and next action for the support team.
Read the customer's message and classify it. Priority is high when the customer is blocked or threatens to cancel.
JSON Schema
{
"type": "object",
"required": [
"category",
"priority",
"summary"
],
"properties": {
"summary": {
"type": "string",
"description": "One sentence"
},
"category": {
"enum": [
"billing",
"technical",
"shipping",
"account",
"other"
],
"type": "string"
},
"priority": {
"enum": [
"low",
"normal",
"high"
],
"type": "string"
},
"sentiment": {
"enum": [
"positive",
"neutral",
"negative"
],
"type": "string"
},
"next_action": {
"type": "string",
"description": "What the support team should do"
}
}
}Ejemplo de salida
{
"category": "shipping",
"priority": "high",
"sentiment": "negative",
"summary": "Package marked as delivered but never received.",
"next_action": "Open a carrier claim and offer a replacement."
}Coste estimado
Tokens de entrada por llamada : ≈ 410
| Modelo | Por llamada | Por 1.000 llamadas |
|---|---|---|
| Mistral Large · Mistral AI | 0,00018 € | 0,18 € |
| DeepSeek Flash · DeepSeek | 0,00011 € | 0,11 € |
| DeepSeek V4 Pro · DeepSeek | 0,00048 € | 0,48 € |
| GPT-6 Luna · OpenAI | 0,00004 € | 0,04 € |
| GPT-6 Sol · OpenAI | 0,00072 € | 0,72 € |
| Claude Sonnet 5.5 · Anthropic | 0,00072 € | 0,72 € |
| Claude Opus 5.5 · Anthropic | 0,00144 € | 1,44 € |
| Modelo de código abierto autoalojado (Ollama, vLLM) | 0 € de API (solo el coste del servidor) | |
Solo coste de entrada, sin la respuesta del modelo. Precios públicos estándar de los proveedores (Mistral AI, DeepSeek, OpenAI, Anthropic) convertidos de USD a euros al tipo del BCE del 29 de septiembre de 2026. Estimación: 1 token ≈ 3,6 caracteres.
Common to all 3 regions
Created by the author, no outside source.
Commercial use allowed · credit the author · changes allowed.
Text or data only: no access to files, network or commands.
Hosted in France (Scaleway, Paris). No transfer outside the EU.
European Union · 5/5
No personal data.
No training data: no summary required.
United States · 5/5
No personal data.
No training data: no documentation to publish.
China · 5/5
No personal data.
No training data; AI-generated content published in China must be labelled (2025).
Indicative summary as of 30/09/2026, not a legal certification. Method and sources →
Estadísticas
Me gusta : 0 · Comentarios : 0
Haz clic en un contador para mostrarlo u ocultarlo; pasa el ratón por el gráfico para ver el detalle. Una visita por visitante y día, sin robots; recuento iniciado el 30 de septiembre de 2026.
- Identificador
- contextetech--classify-support-ticket
- Tipo
- Esquemas de salida
- Archivo
- classify-support-ticket.schema.json
- Formato
- JSON (application/json)
- Tamaño
- 723 bytes
- Codificación
- UTF-8
- Tokens estimados
- ≈ 201
- Idioma
- Inglés
- Licencia
- MIT
- Uso comercial
- Permitido
- Datos personales
- Ninguno
- Versión
- 1.0
- Publicado el
- 2 de octubre de 2026 a las 21:54
- Actualizado el
- 2 de octubre de 2026 a las 21:54
- Almacenamiento
- en base de datos
- Usos
- 0
- Me gusta
- 0
classify-support-ticket.schema.json
{
"type": "object",
"required": [
"category",
"priority",
"summary"
],
"properties": {
"summary": {
"type": "string",
"description": "One sentence"
},
"category": {
"enum": [
"billing",
"technical",
"shipping",
"account",
"other"
],
"type": "string"
},
"priority": {
"enum": [
"low",
"normal",
"high"
],
"type": "string"
},
"sentiment": {
"enum": [
"positive",
"neutral",
"negative"
],
"type": "string"
},
"next_action": {
"type": "string",
"description": "What the support team should do"
}
}
}API de Anthropic (Python)
import json, anthropic
schema = json.load(open("classify-support-ticket.schema.json"))
client = anthropic.Anthropic()
resp = client.messages.create(model="claude-sonnet-5", max_tokens=1024,
tools=[{"name": "extraire", "description": "Renvoie les données extraites", "input_schema": schema}],
tool_choice={"type": "tool", "name": "extraire"},
messages=[{"role": "user", "content": "tu entrada aquí"}])
print(resp.content[0].input)Formato OpenAI (response_format)
{
"type": "json_schema",
"json_schema": {
"name": "classify-support-ticket",
"schema": {
"type": "object",
"required": [
"category",
"priority",
"summary"
],
"properties": {
"summary": {
"type": "string",
"description": "One sentence"
},
"category": {
"enum": [
"billing",
"technical",
"shipping",
"account",
"other"
],
"type": "string"
},
"priority": {
"enum": [
"low",
"normal",
"high"
],
"type": "string"
},
"sentiment": {
"enum": [
"positive",
"neutral",
"negative"
],
"type": "string"
},
"next_action": {
"type": "string",
"description": "What the support team should do"
}
}
},
"strict": true
}
}
Comunidad
Aún no hay comentarios. Comparte tu opinión, ayudará a los siguientes.