This document explains the Ask AI node, which lets you interact with AI models to process text and generate responses.

Node Inputs

Required Fields

  • Prompt: Main instruction or question for the AI. It should be clear and detailed to guide the AI to give you the best possible answer.

Optional Fields

  • Context: Additional information to help AI effectively respond to the query in the prompt. Context can be referenced in the prompt.

More Options

  • Prompt Template: Structure for combining prompt and context

    • Default Template:
      Given the context:
      <context>
      {context}
      </context>
      Respond to the user's query: {prompt}
      
    • Visible under “More Options” in the node
    • Only modify if default structure doesn’t meet your needs
    • Contains placeholders {prompt} and {context}
    • Stays constant across runs unless modified
  • Choose AI Model: Select the AI model you want to use

  • Temperature: Controls response creativity (0-1). Default temparture is ‘1’

    • 0: More focused, consistent
    • 1: More creative, varied
  • Maximum Tokens: Limits response length

  • Cache Response: Save responses for reuse

Show As Input Options

You can expose these fields as inputs to the node by clicking on Configure Inputs:

  • Prompt
  • Context
  • Prompt Template
  • Temperature
  • Maximum Tokens

Key Concepts

Prompt vs. Prompt Template

  1. Prompt:

    • Actual question or instruction for the AI
    • Required input
    • Examples: “Summarize this article”, “Translate to Spanish”
  2. Prompt Template:

    • Defines structure for combining prompt and context
    • Optional parameter
    • Uses placeholders {prompt} and {context}
    • Default template works for most cases
    • Modify only for specific formatting needs

Node Output

  • Response: AI’s generated answer or output

Node Functionality

The Ask AI node connects to various AI models to:

  • Generate text responses
  • Process/analyze content
  • Answer questions
  • Summarize information
  • Convert data formats

Available AI Models

  • Claude 3.5 Sonnet
  • Claude 3 Haiku
  • OpenAI o1
  • OpenAI o1 mini
  • GPT-4o
  • GPT-4o Mini
  • Gemini 1.5 Pro/Flash
  • Azure OpenAI
  • And more

Note: Auto-Select uses a third-party model routing service and automatically chooses the appropriate model for cost, performance, and availability. Not ideal if consistent model behavior is needed.

Common Use Cases

  1. Content Creation:
Prompt: "Write a blog post about {topic}"
Context: Key points and style guide
  1. Data Analysis:
Prompt: "Analyze these sales figures"
Context: Monthly sales data
  1. Customer Support:
Prompt: "Answer this customer question professionally"
Context: Customer query and company policies

Loop Mode Pattern

  1. Batch Processing:
    Input: List of articles
    Prompt: "Analyze and find key patterns in this article:"
    Context: {current_article}
    Result: Analysis for each article
    

Important Considerations

  1. Credit Costs:

    • Expert models (OpenAI o1): 30 credits
    • Advanced models (GPT-4o & Claude 3.5): 20 credits
    • Standard models: 2 credits per run
    • With API key: 1 credit (configure in credentials page)
  2. Function Calling:

  3. Model Selection:

    • Choose specific models for consistent behavior
    • Consider task complexity when selecting models

In summary, the Ask AI node is your interface to AI models, helping you automate text processing and generation tasks with customizable control over the output style and format.