Caso de integraciónIntegration case
Mesa de ayuda: qué pasa cuando la respuesta del modelo sale malHelp desk: what happens when the model's answer goes wrong
Una aplicación de soporte le pide a un LLM que convierta diez mensajes de clientes en tickets. Cambia
una sola cosa: cómo se lee la respuesta. Corre en tu navegador con js/mini.js, el mismo motor del playground,
con respuestas grabadas o —si pones tu propia clave— llamando a DeepSeek o Groq de verdad.
A support application asks an LLM to turn ten customer messages into tickets. Only one thing changes:
how the answer is read. It runs in your browser with js/mini.js, the same engine as the playground,
on recorded answers or —with your own key— calling DeepSeek or Groq for real.
La clave va solo del navegador al proveedor, nunca a mini-format.pmoluna.com: se guarda en
sessionStorage y se borra al cerrar la pestaña. Bajar el límite provoca un corte real.
The key goes from your browser straight to the provider, never to mini-format.pmoluna.com:
it is kept in sessionStorage and cleared when the tab closes. Lowering the limit causes a real cut.
Respuesta del modeloThe model's answer .mini
Tickets registradosRegistered tickets 0
Lo único que cambia: la instrucción que recibe el modeloThe only thing that changes: the instruction the model receives
Los diez mensajes que entranThe ten incoming messages
Con .mini — bloque de prompt del contratoWith .mini — the contract's prompt block
Con JSON — el JSON Schema del ticketWith JSON — the ticket's JSON Schema
El contrato tk no se escribió a mano: sale del mismo JSON Schema con
mini from-schema. La aplicación no cambia de dominio ni de base de datos.
The tk contract was not written by hand: it comes from that same JSON Schema via
mini from-schema. The application's domain and database do not change.
Con un modelo realWith a real model
En modo Grabado la simulación de arriba reproduce respuestas guardadas, para que el resultado sea siempre el mismo; eligiendo DeepSeek o Groq con tu clave, esas mismas llamadas salen de verdad. Estas cifras son de la aplicación de escritorio equivalente, con los mismos diez mensajes y temperatura 0. In Recorded mode the simulation above replays stored answers, so the result is always the same; picking DeepSeek or Groq with your key makes those same calls for real. These figures come from the equivalent desktop application, with the same ten messages and temperature 0.
Cuánto aguanta una respuesta, y cuánto cuestaHow much fits in one answer, and what it costs
Un modelo tiene un límite de tokens de salida, así que un lote grande no cabe. Estas cifras son de con lotes de 10 a 400 registros: hasta dónde llega cada formato, qué se puede aprovechar cuando la respuesta se corta y cuánto cuesta procesar el volumen. A model has an output-token limit, so a large batch does not fit. These figures come from with batches of 10 to 400 records: how far each format gets, what can be salvaged when the answer is cut, and what processing the volume costs.
Tabla de datos del barridoSweep data table
Cómo se integraHow to integrate it
Tres pasos, sin tocar el dominio de la aplicación: el contrato sale del esquema que ya tenías, el prompt sale del contrato y la lectura valida y repara. Three steps, without touching the application's domain: the contract comes from the schema you already had, the prompt comes from the contract, and reading validates and repairs.
-
1
Genera el contrato desde tu JSON Schema.Generate the contract from your JSON Schema.
mini from-schema ticket.schema.json -p tk --out contrato_tk.json -
2
Pide la respuesta con el bloque de prompt del contrato.Ask for the answer using the contract's prompt block.
spec_block(contrato, "es") -
3
Lee en modo tolerante y repara solo lo que falló.Read in lenient mode and repair only what failed.
parse(texto, contrato, strict=False) · repair_request · merge_repair
Paso a paso completo en el inicio rápido · índice de errores en /docs/errors/ · prueba tus propios documentos en el playground. Full walkthrough in the quickstart · error index at /docs/errors/ · try your own documents in the playground.