Skip to main content
Use a generative prompt node to generate AI-driven content using large language models (LLMs). To configure a generative prompt node in your agentic workflow, call the prompt() method. In this method, define the following parameters:
name
string
required
Unique identifier for the node.
display_name
string
Display name for the node.
system_prompt
string or list[string]
Initial instructions that guide the LLM’s behavior.
It also supports expressions. For example: flow.input.variable_1.
user_prompt
string or list[string]
The specific request or task you want the LLM to perform.
It also supports expressions. For example: flow.input.variable_1.
prompt_examples
list[PromptExample]
Examples of user prompts. You can configure:
  • input: The example input prompt.
  • expected_output: The expected output for the given input.
  • enabled: A boolean value to enable or disable the example.
llm
string
LLM used for content generation.
llm_parameters
PromptLLMParameters
Parameters for the LLM. You can configure:
  • temperature: Controls randomness. Higher values produce more diverse outputs.
  • min_new_tokens: Sets the minimum number of tokens to generate.
  • max_new_tokens: Sets the maximum number of tokens to generate.
  • top_k: Limits token selection to the top k most likely options.
  • top_p: Uses nucleus sampling to select from the top p cumulative probability.
  • stop_sequences: Defines sequences that stop generation when encountered.
description
string
Description of the node.
input_schema
type[BaseModel]
Input schema for the LLM.
output_schema
type[BaseModel]
Output schema for the LLM.
input_map
DataMap
Define input mappings using a structured collection of Assignment objects.
error_handler_config
NodeErrorHandlerConfi
Defines the configuration for the retry option using a JSON structure. In this JSON, set the following fields:
  • error_message: an optional string that describes the retry error.
  • max_retries: an optional integer that limits how many times the node retries.
  • retry_interval: an optional integer that sets the interval between retries in milliseconds.
The following example shows how to configure a generative prompt node in a Python function and instantiate it in an agentic workflow:
Python