Automatización de soporteSupport automation
De mensajes de soporte
a tickets listos para usar.From support messages
to usable tickets.
Una empresa recibe quejas y consultas de sus clientes. Su equipo pierde tiempo leyendo cada mensaje y creando un ticket a mano: una ficha con asunto, categoría y prioridad para asignar el problema.A company receives customer complaints and questions. Its team spends time reading each message and manually creating a ticket: a record with a title, category and priority to assign the issue.
La empresa automatiza esa tarea. Su aplicación envía los mensajes a una IA, que los interpreta y genera un ticket por mensaje. Pide el resultado en JSON, un formato de datos que el código puede guardar y filtrar.The company automates this task. Its app sends messages to AI, which interprets them and generates one ticket per message. It requests JSON, a data format the code can store and filter.
Lo que escribe el clienteWhat the customer writes
«No puedo entrar: mi contraseña dejó de funcionar.»
Lo que necesita la aplicaciónWhat the app needs
{"id": 1, "titulo": "Error al iniciar sesión",
"categoria": "acceso", "prioridad": "alta"}Aquí procesaremos 20 mensajes y obtendremos 20 objetos JSON: cada objeto es un ticket. .mini cambia cómo escribe la IA esa respuesta; el resultado para la aplicación conserva los mismos datos.Here we process 20 messages and get 20 JSON objects: each object is one ticket. .mini changes how AI writes that response; the application result keeps the same data.
1. ¿Por qué cambiar la respuesta JSON?1. Why change the JSON response?
En cada ticket, JSON repite los nombres "titulo", "categoria" y "prioridad", además de comillas y signos. Esa repetición también se genera y se factura. Los tokens son fragmentos de texto: la API cuenta los que recibe (entrada) y los que genera (salida) para calcular el coste.In every ticket, JSON repeats the field names "titulo", "categoria" and "prioridad", plus quotes and punctuation. This repetition is also generated and billed. Tokens are pieces of text: the API counts what it receives (input) and generates (output) to calculate cost.
TOON reduce esa repetición declarando campos una vez en tablas. .mini también los declara una vez, en un contrato adaptado al dominio de la aplicación. El contrato fija el orden y los tipos; la IA escribe principalmente los valores. Por eso no hay que volver a escribir cada nombre en cada ticket.TOON reduces repetition by declaring fields once in tables. .mini also declares them once, in a contract tailored to the application's domain. The contract fixes their order and types; AI mostly writes values. Each ticket no longer repeats every field name.
El mismo resultado de 20 tickets, contado con o200k_base:The same 20-ticket result, counted with o200k_base:
| RespuestaResponse | Tokens de salidaOutput tokens |
|---|---|
| JSON | 443 |
| TOON | 304 |
| .mini | 278 |
.mini usa un 37,2 % menos que JSON y un 8,6 % menos que TOON en esta salida. Menos tokens de salida pueden reducir esa parte de la factura..mini uses 37.2% fewer output tokens than JSON and 8.6% fewer than TOON in this example. Fewer output tokens can reduce that part of the bill.
No es el coste total: el prompt .mini de este caso tiene 571 tokens y la corrección también cuesta tokens. En lotes pequeños ese gasto puede superar el ahorro. Mide el flujo completo con tu modelo.This is not total cost: this case's .mini prompt has 571 tokens and correction also costs tokens. On small batches, this overhead can exceed the output saving. Measure the full workflow with your model.
Explorar el coste completo →Explore total cost →2. Prepara el formato y conecta tu aplicación2. Prepare the format and connect your app
- Guarda un JSON real de tu IA.Save a real JSON response from your AI. Debe mostrar los campos y tipos que necesita tu aplicación.It should show the fields and types your application needs.
mini setupElige español o inglés e indica tu muestra JSON. Crea contract.json (reglas de los campos), prompt.es.md o prompt.en.md (instrucciones para la IA) y workflow.py (código que comprueba y convierte la respuesta).Choose Spanish or English and your JSON sample. It creates contract.json (field rules), prompt.es.md or prompt.en.md (AI instructions) and workflow.py (code that checks and converts the response).- Elige el archivo que llama a tu IA.Select the file that calls your AI. Setup prepara la integración en ese archivo. Tu código envía el contenido del prompt generado y pide .mini. El workflow valida, usa Repair, pide una corrección si hace falta, comprueba otra vez y convierte a JSON.Setup prepares integration in that file. Your code sends the generated prompt's contents and requests .mini. The workflow validates, uses Repair, requests a correction if needed, checks again and converts to JSON.
- ¿Todavía no tienes un flujo?No workflow yet? Elige esa opción en setup. Conserva el kit: el comando para conectarlo más adelante queda en README.md y GUIA.md.Select that option in setup. Keep the toolkit: the command to connect it later is saved in README.md and GUIA.md.
- Prueba antes de guardar datos reales.Test before storing real data. Copia try-prompt.md a tu IA: pide 20 objetos ficticios con tu contrato. Un registro es un objeto; aquí, un ticket. El workflow comprueba toda la respuesta antes de entregarla.Paste try-prompt.md into your AI: it asks for 20 fictional objects using your contract. A record is one object; here, one ticket. The workflow checks the entire response before delivery.
La edición automática cubre un patrón Python de chat completions + json.loads. Para otros SDK y lenguajes se genera una guía con las rutas reales para tu IA de código. El callback permite conservar tu proveedor.Automatic editing covers a Python chat completions + json.loads pattern. Other SDKs and languages receive a coding-AI guide with actual paths. The callback keeps your provider.
Instalar y seguir la guía →Install and follow the guide →Probar con una IA real y mi API keyTry a real AI with my API key
Descarga el paquete, instálalo y abre el formulario local:Download and install the package, then open the local form:
python examples/flujo-soporte/run.py --serve
El formulario tiene un campo para tu API key y el modelo. La clave se usa en memoria; no se guarda. Puedes seguir usando la grabación sin clave. Las llamadas reales y las correcciones se facturan por tu proveedor.The form has fields for your API key and model. The key stays in memory and is not saved. Replay remains available without a key. Your provider bills real calls and corrections.
3. Sigue una ejecución, desde la IA hasta el JSON3. Follow a run, from AI to JSON
Repite una ejecución guardada de 20 tickets, sin API key. Muse escribió las respuestas de ejemplo; añadimos dos fallos para enseñar la reparación. El contrato, el validador, el reparador y el parser Python sí se ejecutaron.Replay a saved 20-ticket run without an API key. Muse authored the example responses; two errors were inserted to demonstrate repair. The contract, validator, repairer and Python parser were actually executed.
Listo. No se llamará a una API.Ready. No API call will be made.
Ver los 20 mensajes de entradaSee the 20 input messages
[
{
"id": 1,
"mensaje": "No puedo entrar: mi contraseña dejó de funcionar."
},
{
"id": 2,
"mensaje": "Tengo dos cobros iguales en la factura de septiembre."
},
{
"id": 3,
"mensaje": "La aplicación tarda un minuto en abrir el panel."
},
{
"id": 4,
"mensaje": "Quiero actualizar la dirección de mi cuenta."
},
{
"id": 5,
"mensaje": "Al descargar el informe aparece un error 500."
},
{
"id": 6,
"mensaje": "El enlace para restablecer mi contraseña caducó."
},
{
"id": 7,
"mensaje": "No veo el pago que hice ayer en mi cuenta."
},
{
"id": 8,
"mensaje": "No llegan las notificaciones por correo."
},
{
"id": 9,
"mensaje": "Necesito invitar a dos compañeros a mi equipo."
},
{
"id": 10,
"mensaje": "El buscador no encuentra un ticket que existe."
},
{
"id": 11,
"mensaje": "La pantalla se queda en blanco al abrir un adjunto."
},
{
"id": 12,
"mensaje": "Necesito cambiar el nombre de mi empresa."
},
{
"id": 13,
"mensaje": "La exportación CSV pierde los acentos de los nombres."
},
{
"id": 14,
"mensaje": "Mi sesión se cierra cada cinco minutos."
},
{
"id": 15,
"mensaje": "La factura tiene un número fiscal antiguo."
},
{
"id": 16,
"mensaje": "El botón de guardar no responde desde el móvil."
},
{
"id": 17,
"mensaje": "Quiero dejar de recibir el resumen semanal."
},
{
"id": 18,
"mensaje": "No puedo subir un PDF de dos megabytes."
},
{
"id": 19,
"mensaje": "Los filtros del panel se reinician al volver."
},
{
"id": 20,
"mensaje": "Necesito descargar todas mis facturas del año."
}
]JSON que recibe la aplicación · 20 ticketsApplication JSON · 20 tickets
Historial: respuesta, error y correcciónHistory: response, error and correction
Las repeticiones se guardan sólo en este navegador.Replays are saved only in this browser.
Probar el formato en el playgroundTry the format in the playground · Más ejemplosMore examples