Template
A component that formats user inputs or the outputs of other components.
A Template component acts as a content formatter. It is usually the upstream component of an Interact component.
Scenarios
Section titled “Scenarios”A Template component is useful for organizing various sources of data or information into specific formats — for example, composing an HTML page from multiple agent outputs, or structuring a report from several retrieved sections.
Quick Reference
Section titled “Quick Reference”| Parameter | Type | Default | Description |
|---|---|---|---|
content | string | "" | The template string. Use {key} placeholders for dynamic values. |
parameters | array | [] | A list of key definitions that map to placeholders in the template. |
Configurations
Section titled “Configurations”Content
Section titled “Content”Used together with Keys to organize various data or information sources into desired formats. Example:
<h2>{subtitle}</h2><div>{content}</div>Where {subtitle} and {content} are defined keys.
A Template component relies on keys (variables) to specify its data or information sources. Its immediate upstream component is not necessarily its input — the arrows in the workflow indicate only the processing sequence.
Values of keys are categorized into two groups:
- Component Output: The value of the key should be a component ID.
- Begin Input: The value of the key should be the name of a global variable defined in the Begin component.