Node Details

  • Name: promptTemplate

  • Type: PromptTemplate

  • Version: 1.0

  • Category: Prompts

Base Classes

  • PromptTemplate

  • BasePromptTemplate

Parameters

Inputs

  1. Template (Required)

    • Type: string

    • Rows: 4

    • Placeholder: "What is a good name for a company that makes {product}?"

    • Description: The prompt template with variables in curly braces { }, which will be replaced with actual values

  2. Format Prompt Values (Optional)

    • Type: json

    • Accept Variable: true

    • List: true

    • Description: JSON object containing values for template variables

    • Example:

      {
        "product": "eco-friendly water bottles"
      }
      

Functionality

  1. Template Processing

    • Variable extraction

    • Placeholder validation

    • Format verification

    • Dynamic content insertion

  2. Value Management

    • JSON parsing

    • Variable mapping

    • Type validation

    • Error checking

Use Cases

  1. Dynamic Content Generation

    • Customized prompts

    • Variable content

    • Consistent formatting

    • Template reuse

  2. Standardization

    • Format consistency

    • Error reduction

    • Quality control

    • Pattern enforcement

Integration Notes

  • Supports variable injection

  • Handles JSON formatting

  • Validates template syntax

  • Manages error states

Best Practices

  1. Template Design

    • Clear variable naming

    • Consistent formatting

    • Descriptive placeholders

    • Proper documentation

  2. Value Management

    • Valid JSON structure

    • Complete variable sets

    • Type consistency

    • Error handling

  3. Performance Optimization

    • Efficient templates

    • Minimal complexity

    • Reusable patterns

    • Clear structure