Advanced 15 min read 🧵 Fabrics

Advanced Fabric Settings

Master input validation, output formatting, and model configuration.

Advanced Fabric Settings

Advanced Fabric Settings

Take your fabrics to the next level with advanced configuration options.

Input Types Deep Dive

Fabrics support 13+ input types, each with specific validation options:

Text Inputs

{
  "type": "text",
  "label": "Blog Topic",
  "placeholder": "Enter your topic",
  "minLength": 10,
  "maxLength": 500,
  "required": true
}

Select Inputs

{
  "type": "select",
  "label": "Tone",
  "options": ["professional", "casual", "humorous"],
  "default": "professional"
}

Slider Inputs

{
  "type": "slider",
  "label": "Creativity",
  "min": 0,
  "max": 100,
  "step": 10,
  "default": 50
}

Image Inputs

{
  "type": "image",
  "label": "Reference Image",
  "maxSize": "10MB",
  "formats": ["png", "jpg", "webp"]
}

Model Configuration

Temperature & Sampling

  • Temperature (0-2): Lower = more focused, higher = more creative
  • Top P: Controls diversity of outputs
  • Max Tokens: Limit output length

Model Selection

Choose models based on task:

  • Claude Sonnet: Best for nuanced writing
  • GPT-4o: Strong reasoning and coding
  • Gemini Flash: Fast, cost-effective
  • DeepSeek: Budget-friendly option

Output Processing

Post-Processing Options

  • Trim whitespace: Clean up output
  • Parse JSON: Structured data extraction
  • Format markdown: Render formatting

Output Validation

{
  "outputType": "json",
  "schema": {
    "type": "object",
    "properties": {
      "title": { "type": "string" },
      "summary": { "type": "string" }
    },
    "required": ["title", "summary"]
  }
}

Conditional Logic

Show/hide fields based on other inputs:

{
  "conditionalFields": [
    {
      "field": "customInstructions",
      "showWhen": {
        "field": "useCustomPrompt",
        "value": true
      }
    }
  ]
}

Best Practices

  1. Validate early: Use input validation to catch errors
  2. Default wisely: Set sensible defaults for optional fields
  3. Document fields: Add help text for complex inputs
  4. Test thoroughly: Try edge cases before publishing
  5. Version control: Use versioning for major changes

Monitoring & Analytics

Track fabric performance:

  • Execution time per run
  • Credit usage patterns
  • Error rates and types
  • User satisfaction (ratings)

Learn more: Fabric Chains | API Documentation

Ready to create?

Put what you've learned into practice with Promptha's AI-powered tools.

Get Started Free