Populate Template Block
Intelligently fill a pre-built template using AI, handling various content types including text, tables, and images
Overview
The Populate Template Block is a powerful tool that combines pre-built templates with AI capabilities to generate comprehensive, context-aware documents. This block takes a template created in our template editor and uses a connected AI model to intelligently fill in the content based on the supplied context and the structure of the document itself.
Inputs
The system prompt to send to the model. This provides high-level instructions or context for the AI model.
The context to support the population of the template. This can include background information, specific requirements, or any other relevant details.
Any images to be used to populate the template. These can be referenced and incorporated into the final document.
Outputs
The completed template document with all fields populated.
The time taken to generate the document in milliseconds.
Editor Settings
The template you wish to populate. Select from available templates in your workspace.
The AI model to use for generating content. Options are dynamically populated based on available models.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
The maximum number of tokens to generate in the chat completion.
Example: Generating a Business Report
- Create a template in the template editor with placeholders for your content
- Add a Populate Template block to your flow
- Select your template from the Templates dropdown
- Configure the AI Model and parameters as needed
- Connect your context and any images to the corresponding inputs
- Run your flow to generate the populated document
Error Handling
The block will retry failed attempts with the following behavior:
- Maximum retry time of 2 minutes
- Exponential backoff starting at 500ms up to 5000ms
- Traces failed attempts for debugging
- Aborts if the process is cancelled
Common errors include:
- Missing template provider
- Missing LLM provider
- Missing file provider
- No template ID selected
- Failed to populate template fields
Always ensure you have the necessary providers configured and a template selected before running the block.