Agent Node
vellum.workflows.nodes.ToolCallingNode
Used to execute a repeatedly invoke a prompt with defined tools until it produces a text output.
Attributes
Optional inputs for variable substitution in the prompt. These inputs are used to replace:
- Variables within Jinja blocks
- Variable blocks in the
blocks
attribute
You can reference either Workflow inputs or outputs from upstream nodes.
The blocks that make up the Prompt
The model to use for execution (e.g., “gpt-4o”, “claude-3.5-sonnet”)
The tools that a the Prompt has access to and automatically invokes on each iteration. The acceptable tool types are:
Callable[..., Any]
- Any function callableType["BaseWorkflow"]
- An Inline SubworkflowDeploymentDefinition
- A reference to a Vellum Workflow Deployment
Model parameters for execution. Defaults to:
- stop: []
- temperature: 0.0
- max_tokens: 4096
- top_p: 1.0
- top_k: 0
- frequency_penalty: 0.0
- presence_penalty: 0.0
- logit_bias: None
- custom_parameters: None
- This field can be used to pass additional parameters to the LLM, like
json_schema
(learn more here).
- This field can be used to pass additional parameters to the LLM, like
The maximum number of iterations that the Tool Calling Node is allowed to call the underlying Prompt before rejecting.
Outputs
The generated text output from the last prompt execution
The array of chat messages produced over the course of the Tool Calling Node’s iterations.
Extra Context
If you are planning to move between the UI and your IDE (via vellum workflows push
), you should use the following folder structure for best results:
- workflow.py
- inputs.py # Optional inputs for your Workflow
- nodes/
- init.py # Exports all of your nodes under all
- prompt_node.py # A node (e.g. a Prompt Node)
- templating_node.py # Another node (e.g. a Templating Node)
- agent/
- init.py # Your actual agent implementation is in the init.py file.
- add.py # Function Tool
- subtract/ # Inline Subworkflow Tool
- init.py
- workflow.py
- inputs.py
- nodes/
- templating.py # Node for the Subworkflow Tool
- nodes/