Skip to main content

Invoke

The invoke() function allows you to execute agents programmatically from Python code, making it easy to test agents, integrate them into applications, and automate workflows.

Configuration

Before invoking agents, configure the SDK with your credentials:
Configuration can also be set via environment variables:
Or via ~/.erdo/config.yaml:
Priority order: erdo.setup() > environment variables > config file

Quick Start

Basic Usage

Invoke with Input

Invoke with Datasets

Invoke with Parameters

Streaming

Stream events in real-time as the agent executes:
Stream with verbose step tracking:

InvokeResult

The invoke() function returns an InvokeResult object:

Understanding the Result Structure

The result field contains the terminal event from the agent service:
The messages field contains visible text output from the agent — this is typically what you want to display to users.

Example Usage

Complete API Reference

Parameters

Keyword Arguments

  • endpoint (str): Custom API endpoint
  • auth_token (str): Custom auth token

Examples

Data Analysis

Batch Processing

Integration with Flask

Error Handling

Best Practices

1. Always Check Success

2. Stream Long-Running Agents

3. Use Appropriate Output Format

Troubleshooting

Authentication Errors

Configure the SDK with valid credentials:
Or use the CLI:
Or set environment variables:

Import Errors

Install the SDK: