LogoLogo
  • Overview
  • Chatbot Features
  • Studio
  • Orchestration Interface
    • Node Orchestration
      • Node
        • Start
        • End
        • Direct Reply
        • LLM
        • Question Classifier
        • Knowledge Retrieval
        • Code Execution
        • Doc Extractor
        • HTTP Request
        • Conditional Branch IF/ELSE
        • Iteration
        • List Operator
        • Parameter Extraction
        • Template
        • Tools
        • Variable Aggregator
        • Variable Assigner
    • Variables
    • Application Toolkits
    • File Upload
  • Dataset
    • Dataset Creation
    • Text Preprocessing and Cleaning
      • Advanced Configuration
    • Retrieval Test/Citation
  • Privacy Policy
Powered by GitBook
On this page

Was this helpful?

  1. Orchestration Interface
  2. Node Orchestration
  3. Node

Template

PreviousParameter ExtractionNextTools

Last updated 2 months ago

Was this helpful?

Template lets you dynamically format and combine variables from previous nodes into a single text-based output using Jinja2, a powerful templating syntax for Python. It's useful for combining data from multiple sources into a specific structure required by subsequent nodes. The simple example below shows how to assemble an article by piecing together various previous outputs:

Beyond naive use cases, you can create more complex templates as per Jinja's for a variety of tasks. Here's one template that structures retrieved chunks and their relevant metadata from a knowledge retrieval node into a formatted markdown:

{% for item in chunks %}
### Chunk {{ loop.index }}. 
### Similarity: {{ item.metadata.score | default('N/A') }}

#### {{ item.title }}

##### Content
{{ item.content | replace('\n', '\n\n') }}

---
{% endfor %}

This template node can then be used within a Advanced Agent to return intermediate outputs to the end user, before a LLM response is initiated.

The Answer node in a Advanced Agent is non-terminal. It can be inserted anywhere to output responses at multiple points within the flow.

documentation