Overview

The Multi-Modal Draft Block leverages AI to generate various types of documents based on user prompts, context, and images. It offers a set of example templates for common document types and an optimized custom template feature for more specific drafting needs. This block intelligently incorporates both textual and visual information to create comprehensive and context-aware documents.

Inputs

systemPrompt
string

The system prompt to send to the model. This provides high-level instructions or context for the AI model.

prompt
string

The prompt to send to the model. Only available when “Use Prompt Input” is enabled.

images
image[]

An array of images to be analyzed and incorporated into the document. Only available when “Multi-Modal” is enabled.

(Template Variables)
string

When using templates, additional inputs are dynamically generated based on the template’s variables. These inputs are used to customize the template output.

Outputs

output
string

The generated document draft based on the inputs and template.

duration
number

The time taken to generate the draft in milliseconds.

wordCount
number

The number of words in the generated draft.

Editor Settings

AI Model
string
default:"gpt-4"

The AI model to use for document generation. Available models are dynamically populated based on your configuration.

Multi-Modal
boolean
default:false

When enabled, allows the block to process both text and image inputs to generate the output.

Use Prompt Input
boolean
default:false

When enabled, allows direct prompt input instead of using templates.

Drafting Prompt Template
string
default:"Legal Brief"

Select from predefined templates: Legal Brief, Research Report, Email, or Letter. Only available when “Use Prompt Input” is disabled.

Word Count
number
default:800

The target word count for the generated document. Only available when “Use Prompt Input” is disabled.

Example Templates

The Draft Block includes the following pre-configured templates:

  • Legal Brief
  • Research Report
  • Email
  • Letter

Each template is optimized for its specific use case and includes relevant variables for customization.

Example: Using a Template

  1. Add a Draft Block to your flow
  2. Select your desired template from “Drafting Prompt Template”
  3. Configure the word count and other settings
  4. Connect required inputs based on the template variables
  5. Run the flow to generate your document

Error Handling

The Draft Block includes robust error handling with automatic retries for:

  • API rate limit exceeded (429 errors)
  • API timeouts (408 errors)
  • Network failures
  • Other recoverable errors

The block will display appropriate error messages and retry automatically when possible.

The block has a maximum retry time of 5 minutes and will throw an error if unable to complete within this timeframe.

FAQ

See Also