Generates a formatted institutional document template (machote) based on the provided prompt and area. The template includes standard elements like institutional header, subject line, date/location, body, signature block, and cc field.
Description of the document to generate. This should specify the purpose and content of the institutional document.Example: "Oficio de solicitud de material de oficina para el departamento"
The governmental area or department requesting the document. If not provided, defaults to “No especificada”.Example: "Recursos Humanos", "Obras Públicas", "Secretaría General"
The generated institutional document template. Contains the complete formatted document with variable placeholders in {{Variable}} format (double braces).The template includes:
curl -X POST http://localhost:5055/api/generate-template \ -H "Content-Type: application/json" \ -d '{ "prompt": "Oficio de solicitud de material de oficina para el departamento", "area": "Recursos Humanos" }'
const response = await fetch('http://localhost:5055/api/generate-template', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: 'Oficio de solicitud de material de oficina para el departamento', area: 'Recursos Humanos' })});const data = await response.json();console.log(data.text);
{ "text": "AYUNTAMIENTO DE {{Municipio}}\n\nASUNTO: Solicitud de Material de Oficina\n\n{{Lugar}}, {{Fecha}}\n\n{{Destinatario}}\n{{Cargo}}\nPresente\n\nPor medio del presente, el Departamento de Recursos Humanos solicita...\n\nATENTAMENTE\n\n{{Firma}}\n{{Cargo}}\n\nC.c.p. {{Copia}}"}