You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

template.mdx 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. sidebar_position: 11
  3. slug: /template_component
  4. ---
  5. # Template component
  6. A component that formats user inputs or the outputs of other components.
  7. ---
  8. A **Template** component acts as a content formatter. It is usually the upstream component of an **Interact** component.
  9. ## Scenarios
  10. A **Template** component is useful for organizing various sources of data or information into specific formats.
  11. ## Configurations
  12. ### Content
  13. Used together with Keys to organize various data or information sources into desired formats. Example:
  14. ```text
  15. <h2>{subtitle}</h2>
  16. <div>{content}</div>
  17. ```
  18. Where `{subtitle}` and `{content}` are defined keys.
  19. ### Key
  20. A **Template** component relies on keys (variables) to specify its data or information sources. Its immediate upstream component is *not* necessarily its input, and the arrows in the workflow indicate *only* the processing sequence.
  21. Values of keys are categorized into two groups:
  22. - **Component Output**: The value of the key should be a component ID.
  23. - **Begin Input**: The value of the key should be the name of a global variable defined in the **Begin** component.
  24. ## Examples
  25. Explore our research report generator agent template, where the **Template** component (component ID: **Article**) organizes user input and the outputs of the **Sections** component into HTML format:
  26. 1. Click the **Agent** tab at the top center of the page to access the **Agent** page.
  27. 2. Click **+ Create agent** on the top right of the page to open the **agent template** page.
  28. 3. On the **agent template** page, hover over the **Research report generator** card and click **Use this template**.
  29. 4. Name your new agent and click **OK** to enter the workflow editor.
  30. 5. Click on the **Template** component to display its **Configuration** window