Skip to main content

Configuration

This guide covers configuration options for the Doc Generator pipeline.

Webhook Input

The webhook accepts JSON input with the following structure:
{
  "topic": "How to implement rate limiting in Go",
  "audience": "senior-engineer",
  "type": "tutorial",
  "constraints": {
    "max_words": 2000,
    "include_code": true,
    "tone": "technical"
  }
}

Required Fields

FieldTypeDescription
topicstringWhat the document should cover

Optional Fields

FieldTypeDefaultDescription
audiencestring”engineer”Target reader profile
typestring”guide”Document type
constraintsobjectAdditional requirements

Audience Profiles

ProfileDescription
junior-engineerMore context, simpler language
senior-engineerConcise, assumes background
architectSystem-level perspective
managerBusiness impact focus
generalNon-technical audience

Document Types

TypeStructure
tutorialStep-by-step with examples
guideComprehensive reference
explanationConceptual deep-dive
referenceAPI/specification format
runbookOperational procedures

Quality Thresholds

Adjust the quality gate:
const config = {
  qualityThreshold: 0.85,  // Minimum acceptable score
  maxIterations: 3,         // Maximum revision attempts
  autoApproveAt: 0.95      // Skip final review if excellent
};

Output Configuration

GitHub Integration

const github = {
  owner: "your-org",
  repo: "docs",
  branch: "main",
  basePath: "content/",
  createPR: true,
  prLabels: ["documentation", "auto-generated"]
};

Slack Notification

const slack = {
  webhookUrl: "https://hooks.slack.com/...",
  channel: "#docs-updates",
  mentionOnFailure: "@docs-team"
};

Airtable Logging

const airtable = {
  baseId: "appXXXXXXXX",
  tableName: "Document Generation Log",
  fields: {
    topic: "Topic",
    quality: "Quality Score",
    iterations: "Iterations",
    duration: "Duration (s)"
  }
};

LLM Configuration

Model Selection

const llm = {
  conceptualDesign: {
    model: "claude-sonnet-4-20250514",
    temperature: 0.3
  },
  draftGenerator: {
    model: "claude-sonnet-4-20250514",
    temperature: 0.5
  },
  qualityReview: {
    model: "claude-sonnet-4-20250514",
    temperature: 0.2
  },
  finalization: {
    model: "claude-sonnet-4-20250514",
    temperature: 0.1
  }
};

Rate Limiting

const throttle = {
  betweenStages: 3000,      // ms between LLM calls
  betweenIterations: 5000,  // ms before revision
  maxRequestsPerMinute: 20
};

Error Handling

Configure failure behavior:
const errorHandling = {
  retryAttempts: 2,
  retryDelay: 10000,
  onFailure: "notify",  // "notify" | "silent" | "escalate"
  fallbackQuality: 0.7  // Accept lower quality after failures
};