Skip to main content
Uses an LLM-based AI model to generate a response based on the prompt given. Image
Available on all channels
Set AI consumes AI credits each time it generates a response. The number of credits used can vary depending on the selected AI model. See AI credits for credit usage and pricing details.
The Set AI action block uses an AI model to generate a value based on your prompt and stores the result in a variable. Unlike blocks that send a response directly to the user, Set AI works in the background. Nothing is displayed to the user unless you use the generated variable in a later block. You can use Set AI to:
  • Classify a user’s message or intent
  • Extract information from a conversation
  • Summarize text or a conversation
  • Rewrite or transform text
  • Generate a value before sending it to an API or another block
Set AI is available on all channels because its output is stored in a variable and is not directly rendered to the user.

Using the Set AI block

Drag the Set AI block onto the canvas and connect it to the previous block.
  1. Add the Set AI block to your flow.
  2. Enter a prompt that describes what the AI should generate.
  3. Select the input variables or conversation context the AI should use.
  4. Select the variable where the generated output should be stored.
  5. Define the required output format.
  6. Configure the model settings if required.
  7. Connect the Set AI block to the next block.
The generated value is stored in the selected variable and can be used by subsequent blocks.

Configuration

Prompt

A prompt is nothing but an instruction that helps the LLM know what to remember and follow while generating an answer. The more clear, concise and brief your instruction, the more accurate your answers will be from the AI. Things to write in your prompt:
  • Objective - What is its objective
  • Output format - Typically would be HTML/markdown.
  • Writing style - How should the answers be written.
  • Don’ts - Clear instructions of what to avoid.
  • Examples - Examples of question and answer.
For example:
See Prompts for more information.

Input

Input defines the information passed to the AI when generating the output. You can provide information such as:
  • User messages
  • Conversation context
  • Variables
  • Other available input data
Select the information the AI needs to complete the task defined in the prompt.

Save to variable

Save to variable determines where the generated output is stored. For example, if you select the intent variable, Set AI stores the generated category in intent. You can then use the variable in later blocks, such as a Condition block, API call, or message block. Image Learn more about variables

Output format

Use Output format to define the structure of the generated value. For example, you can ask Set AI to return:
  • A single word
  • A classification label
  • A number
  • A short sentence
  • A JSON object
When the output is used by another block or API, define the format precisely so the generated value is predictable and easy to process.

Advances Settings

Image

Model settings

Use Model settings to select the AI model and configure available parameters such as temperature. For tasks such as classification and data extraction, use settings that produce consistent results.

Max Tokens

A token is a small unit of text that an AI model processes when reading your question, knowledge base content, or generating a response. Example: If a user asks:
“What is your refund policy?”
The AI breaks the text into smaller pieces called tokens before processing it.
  • 1 token ≈ 4 characters but actual token usage may vary depending on the language, words, and AI model.
  • Shorter responses use fewer credits, and longer or more complex responses use more. You only pay for what you actually use.
Value should be between 1 - 2000

Temperature

Temperature controls how consistent or varied the AI-generated output is.
  • A value closer to 0 produces more consistent responses.
  • A value closer to 1 produces more varied responses.
The default temperature is 0.5. For tasks such as classification or data extraction, a lower temperature can help produce more consistent results.

Chunks

When the AI is asked a question, it first fetches relevant content from the knowledge base, which is then sent to the LLM model to generate an answer. The more relevant content the AI can fetch, the more chances of accurate responses are. The number indicates the number of relevant responses which will be fetched from the knowledge base. Select the number of knowledge base chunks Answer AI should use when generating a response.

Choose a value between 1 and 10 from the dropdown.

  • A lower number uses fewer chunks and can produce a more focused response.
  • A higher number gives Answer AI more relevant knowledge base content to consider when answering the question.

Include Chat History

Enable Include Chat History to provide the conversation history as context when generating the output. This can be useful when the current user message depends on information from earlier messages in the conversation. For example, if the user first asks about a product and then asks, “What is its price?”, including chat history allows the AI to understand what “its” refers to.

Example: Classify a user message

A common use of Set AI is to classify an incoming message and then route the conversation based on the result. For example, you can classify messages into three categories:
  • Sales
  • Support
  • Other

Step 1: Configure Set AI

Set the prompt to:
Pass the user’s message as the input and save the result to the intent variable. For example, if the user says:
Set AI can generate:
The value Sales is then stored in the intent variable.

Step 2: Add a Condition block

After Set AI, add a Condition block and check the value stored in intent. For example:
  • If intent = Sales → Continue to the sales flow
  • If intent = Support → Continue to the support flow
  • If intent = Other → Continue to the general flow
This allows Set AI to perform the AI processing while the Condition block controls what happens next.

Output path

Set AI has a single output path that continues to the next block after the AI finishes processing. The generated value is stored in the selected variable before the flow continues. If the AI does not generate the expected value, validate the variable in a later block before using it for actions that depend on a specific format or value.

Variables set

Set AI writes the generated value to the variable selected in Save to variable. For example: The intent variable can then be used in subsequent blocks, such as a Condition block, API call, or message block. The Set AI block does not display the generated value to the user by itself. Use the stored variable in a later block when you want to display or process the output.
Last modified on November 6, 2026