Invoke
Theinvoke() 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:~/.erdo/config.yaml:
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:InvokeResult
Theinvoke() function returns an InvokeResult object:
Understanding the Result Structure
Theresult field contains the terminal event from the agent service:
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
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_key | str | required | Agent key (e.g., "data-question-answerer") |
input | str | None | User input string |
parameters | dict | None | Parameters to pass to the agent |
datasets | list | None | Dataset slugs to include (e.g., ["sales-2024"]) |
stream | bool | False | Stream events in real-time |
output_format | str | "events" | "events" (raw), "text" (formatted), or "json" (summary) |
verbose | bool | False | Show step execution details (text format only) |
print_events | bool | False | Print all raw events as they arrive |
Keyword Arguments
endpoint(str): Custom API endpointauth_token(str): Custom auth token

