GenerationDraft Generator
Overview
The Draft Generator is a two-step document automation system that extracts templates from existing documents and generates customized drafts with variable substitution. This powerful tool enables automated document generation for contracts, agreements, forms, and other structured documents.
How It Works
The Draft Generator consists of two complementary APIs:
Step 1: Generate Template
POST /api/agent/draft/generate_template
Analyzes an uploaded document and extracts a structured template by identifying all variables, fields, and placeholders. Returns a fillable form with categories, labels, types, and current values.
Step 2: Create Draft
POST /api/agent/draft/create_draft
Takes the extracted template with user-modified values and generates a new formatted HTML document with all substitutions applied.