Additional Toolkits
Daytona
Enable your Agents to run code in a remote, secure sandbox.
Daytona offers secure and elastic infrastructure for runnning your AI-generated code. At Agno, we integrate with it to enable your Agents and Teams to run code in your Daytona sandboxes.
Prerequisites
The Daytona tools require the daytona_sdk
Python package:
You will also need a Daytona API key. You can get it from your Daytona account:
Example
The following example demonstrates how to create an agent that can run Python code in a Daytona sandbox:
cookbook/tools/daytona_tools.py
Toolkit Params
Parameter | Type | Default | Description |
---|---|---|---|
api_key | str | None | Daytona API key. If not provided, uses DAYTONA_API_KEY env var. |
api_url | str | None | Daytona API URL. If not provided, uses DAYTONA_API_URL env var or the Daytona default. |
sandbox_language | CodeLanguage | Python | The programming language to run on the sandbox |
sandbox_target_region | str | None | The region where the sandbox will be created |
sandbox_os | str | None | The operating system to run on the sandbox (default: ubuntu) |
sandbox_os_user | str | None | The user to run the sandbox as (default: root) |
sandbox_env_vars | dict | None | The environment variables to set in the sandbox |
sandbox_labels | dict | None | The labels to set in the sandbox |
sandbox_public | bool | None | Whether the sandbox should be public |
sandbox_auto_stop_interval | int | None | The interval in seconds at which the sandbox will be automatically stopped |
organization_id | str | None | The organization ID to use for the sandbox |
timeout | int | 300 | Timeout in seconds for communication with the sandbox (default: 5 minutes) |
Code Execution Tools
Function | Description |
---|---|
run_python_code | Run Python code in the contextual Daytona sandbox |
run_code | Run non-Python code in the contextual Daytona sandbox |
Developer Resources
- View Tools
- View Cookbook
- View Daytona Documentation