🛠️ Tools¶
evoagentx.tools ¶
Tool ¶
Bases: BaseModule
Source code in evoagentx/core/module.py
required
class-attribute
instance-attribute
¶
inputs: {"input_name": {"type": "string", "description": "input description"}, ...}
DockerInterpreterToolkit ¶
DockerInterpreterToolkit(name: str = 'DockerInterpreterToolkit', image_tag: Optional[str] = None, dockerfile_path: Optional[str] = None, require_confirm: bool = False, print_stdout: bool = True, print_stderr: bool = True, host_directory: str = '', container_directory: str = '/home/app/', container_command: str = 'tail -f /dev/null', tmp_directory: str = '/tmp', storage_handler: FileStorageHandler = None, auto_cleanup: bool = True, auto_destroy: bool = True, **kwargs)
Bases: Toolkit
Source code in evoagentx/tools/interpreter_docker.py
cleanup ¶
Clean up the Docker interpreter and storage handler.
Source code in evoagentx/tools/interpreter_docker.py
BrowserToolkit ¶
BrowserToolkit(name: str = 'BrowserToolkit', browser_type: str = 'chrome', headless: bool = False, timeout: int = 10, **kwargs)
Bases: Toolkit
Browser toolkit with auto-initialization and cleanup.
The browser is automatically initialized when any tool is first used, and automatically closed when the toolkit instance is destroyed. No explicit initialization or cleanup is required.
Source code in evoagentx/tools/browser_tool.py
MCPToolkit ¶
MCPToolkit(servers: Optional[list[MCPClient]] = None, config_path: Optional[str] = None, config: Optional[dict[str, Any]] = None)
Source code in evoagentx/tools/mcp.py
get_toolkits ¶
Return a flattened list of all tools across all servers
Source code in evoagentx/tools/mcp.py
BrowserUseToolkit ¶
BrowserUseToolkit(name: str = 'BrowserUseToolkit', model: str = 'gpt-4o-mini', api_key: str = None, browser_type: str = 'chromium', headless: bool = True)
Bases: Toolkit
Toolkit for browser automation using Browser Use.
Initialize the BrowserUse toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Toolkit name |
'BrowserUseToolkit'
|
model
|
str
|
LLM model to use |
'gpt-4o-mini'
|
api_key
|
str
|
API key for the LLM |
None
|
browser_type
|
str
|
Browser type (chromium, firefox, webkit) |
'chromium'
|
headless
|
bool
|
Whether to run browser in headless mode |
True
|
Source code in evoagentx/tools/browser_use.py
GoogleMapsToolkit ¶
Bases: Toolkit
Complete Google Maps Platform toolkit containing all available tools.
Initialize the Google Maps toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key
|
str
|
Google Maps Platform API key. If not provided, will try to get from GOOGLE_MAPS_API_KEY environment variable. |
None
|
timeout
|
int
|
Request timeout in seconds |
10
|
name
|
str
|
Toolkit name |
'GoogleMapsToolkit'
|
Source code in evoagentx/tools/google_maps_tool.py
MongoDBToolkit ¶
MongoDBToolkit(name: str = 'MongoDBToolkit', connection_string: str = None, database_name: str = None, local_path: str = None, auto_save: bool = True, read_only: bool = False, **kwargs)
Bases: Toolkit
MongoDB-specific toolkit with simplified design. Automatically handles remote, local file-based, or new database creation.
Initialize the MongoDB toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'MongoDBToolkit'
|
connection_string
|
str
|
MongoDB connection string (for remote/existing) |
None
|
database_name
|
str
|
Name of the database to use |
None
|
local_path
|
str
|
Path for local file-based database |
None
|
auto_save
|
bool
|
Automatically save changes to local files |
True
|
read_only
|
bool
|
If True, only read operations are allowed (no insert, update, delete) |
False
|
**kwargs
|
Additional connection parameters |
{}
|
Source code in evoagentx/tools/database_mongodb.py
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 |
|
get_capabilities ¶
Get MongoDB-specific capabilities
Source code in evoagentx/tools/database_mongodb.py
get_local_info ¶
Get information about local database setup
Source code in evoagentx/tools/database_mongodb.py
FileStorageHandler ¶
Bases: StorageBase
Unified storage handler that provides a consistent interface for all storage operations. This class serves as the main entry point for storage operations, inheriting from StorageBase and providing the core CRUD operations (Create, Read, Update, Delete).
Initialize the storage handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_path
|
str
|
Base directory for storage operations (default: current directory) |
'.'
|
**kwargs
|
Additional keyword arguments for parent class initialization |
{}
|
Source code in evoagentx/tools/storage_handler.py
translate_in ¶
Translate input file path by combining it with base_path. This method takes a user-provided path and converts it to the full system path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
User-provided file path (can be relative or absolute) |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Full system path combining base_path and file_path |
Source code in evoagentx/tools/storage_handler.py
translate_out ¶
Translate output full path by removing the base_path prefix. This method takes a full system path and converts it back to the user-relative path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
full_path
|
str
|
Full system path |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
User-relative path with base_path removed |
Source code in evoagentx/tools/storage_handler.py
create_file ¶
Create a new file with the specified content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path where the file should be created |
required |
content
|
Any
|
Content to write to the file |
required |
**kwargs
|
Additional arguments for file creation (encoding, format, etc.) |
{}
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
read_file ¶
Read content from an existing file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path of the file to read |
required |
**kwargs
|
Additional arguments for file reading (encoding, format, etc.) |
{}
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with file content and success status |
Source code in evoagentx/tools/storage_handler.py
update_file ¶
Update an existing file with new content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path of the file to update |
required |
content
|
Any
|
New content to write to the file |
required |
**kwargs
|
Additional arguments for file update (encoding, format, etc.) |
{}
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
delete_file ¶
Delete a file or directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path of the file or directory to delete |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
list_files ¶
List files and directories in the specified path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Path to list (default: base_path) |
None
|
max_depth
|
int
|
Maximum depth for recursive listing |
3
|
include_hidden
|
bool
|
Whether to include hidden files |
False
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with file list and success status |
Source code in evoagentx/tools/storage_handler.py
file_exists ¶
Check if a file exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path of the file to check |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if file exists, False otherwise |
Source code in evoagentx/tools/storage_handler.py
get_file_information ¶
Get comprehensive information about a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path of the file to get information for |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: File information including size, type, timestamps, etc. |
Source code in evoagentx/tools/storage_handler.py
create_directory ¶
Create a new directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Path where the directory should be created |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
copy_file ¶
Copy a file from source to destination.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
str
|
Source file path |
required |
destination
|
str
|
Destination file path |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
move_file ¶
Move/rename a file from source to destination.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
str
|
Source file path |
required |
destination
|
str
|
Destination file path |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
append_to_file ¶
Append content to an existing file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path of the file to append to |
required |
content
|
Any
|
Content to append |
required |
**kwargs
|
Additional arguments for appending (encoding, format, etc.) |
{}
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation with success status and details |
Source code in evoagentx/tools/storage_handler.py
save ¶
Save content to a file (alias for create_file). This method is expected by some tools like flux image generation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path where the file should be saved |
required |
content
|
Any
|
Content to save to the file |
required |
**kwargs
|
Additional arguments for file creation |
{}
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Result of the operation |
Source code in evoagentx/tools/storage_handler.py
LocalStorageHandler ¶
Bases: FileStorageHandler
Local filesystem storage implementation. Provides all file operations for local storage with default working directory.
Initialize local storage handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_path
|
str
|
Base directory for storage operations (default: current directory) |
'.'
|
**kwargs
|
Additional keyword arguments for parent class initialization |
{}
|
Source code in evoagentx/tools/storage_handler.py
get_file_info ¶
Get comprehensive information about a file
Source code in evoagentx/tools/storage_handler.py
SupabaseStorageHandler ¶
Bases: FileStorageHandler
Supabase remote storage implementation. Provides file operations via Supabase Storage API with environment-based configuration.
Initialize Supabase storage handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bucket_name
|
str
|
Supabase storage bucket name (default: from environment or "default") |
None
|
base_path
|
str
|
Base path for storage operations (default: "/") |
'/'
|
**kwargs
|
Additional keyword arguments for parent class initialization |
{}
|
Source code in evoagentx/tools/storage_handler.py
get_file_info ¶
Get comprehensive information about a file in Supabase Storage
Source code in evoagentx/tools/storage_handler.py
StorageToolkit ¶
StorageToolkit(name: str = 'StorageToolkit', base_path: str = './workplace/storage', storage_handler: FileStorageHandler = None)
Bases: Toolkit
Comprehensive storage toolkit with local filesystem operations. Provides tools for reading, writing, appending, deleting, moving, copying files, creating directories, and listing files with support for various file formats.
Initialize the storage toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'StorageToolkit'
|
base_path
|
str
|
Base directory for storage operations (default: ./workplace/storage) |
'./workplace/storage'
|
storage_handler
|
FileStorageHandler
|
Storage handler instance (defaults to LocalStorageHandler) |
None
|
Source code in evoagentx/tools/storage_file.py
FluxImageGenerationToolkit ¶
FluxImageGenerationToolkit(name: str = 'FluxImageGenerationToolkit', api_key: str = None, save_path: str = './imgs', storage_handler: FileStorageHandler = None)
Bases: Toolkit
Toolkit for Flux image generation with storage handler integration.
Initialize the Flux image generation toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'FluxImageGenerationToolkit'
|
api_key
|
str
|
API key for Flux image generation |
None
|
save_path
|
str
|
Default save path for images |
'./imgs'
|
storage_handler
|
FileStorageHandler
|
Storage handler for file operations |
None
|
Source code in evoagentx/tools/images_flux_generation.py
OpenAIImageGenerationToolkit ¶
OpenAIImageGenerationToolkit(name: str = 'OpenAIImageGenerationToolkit', api_key: str = None, organization_id: str = None, model: str = 'gpt-4o', save_path: str = './', storage_handler: FileStorageHandler = None)
Bases: Toolkit
Toolkit for OpenAI image generation with storage handler integration.
Initialize the OpenAI image generation toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'OpenAIImageGenerationToolkit'
|
api_key
|
str
|
API key for OpenAI |
None
|
organization_id
|
str
|
Organization ID for OpenAI |
None
|
model
|
str
|
Model to use for image generation |
'gpt-4o'
|
save_path
|
str
|
Default save path for images |
'./'
|
storage_handler
|
FileStorageHandler
|
Storage handler for file operations |
None
|
Source code in evoagentx/tools/images_openai_generation.py
ImageAnalysisToolkit ¶
ImageAnalysisToolkit(name: str = 'ImageAnalysisToolkit', api_key: str = None, model: str = 'openai/gpt-4o', storage_handler: FileStorageHandler = None)
Bases: Toolkit
Toolkit for image analysis with storage handler integration.
Initialize the image analysis toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'ImageAnalysisToolkit'
|
api_key
|
str
|
API key for OpenRouter |
None
|
model
|
str
|
Model to use for image analysis |
'openai/gpt-4o'
|
storage_handler
|
FileStorageHandler
|
Storage handler for file operations |
None
|
Source code in evoagentx/tools/image_analysis.py
CMDToolkit ¶
CMDToolkit(name: str = 'CMDToolkit', default_shell: str = None, storage_handler: FileStorageHandler = None)
Bases: Toolkit
Command line toolkit that provides safe command execution with permission checking and cross-platform support. Supports Linux, macOS, and Windows.
Initialize the CMDToolkit with a shared command base instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'CMDToolkit'
|
default_shell
|
str
|
Override default shell detection |
None
|
storage_handler
|
FileStorageHandler
|
Storage handler for file operations |
None
|
Source code in evoagentx/tools/cmd_toolkit.py
RSSToolkit ¶
Bases: Toolkit
Toolkit for RSS feed operations.
Source code in evoagentx/tools/rss_feed.py
SerperAPIToolkit ¶
SerperAPIToolkit(name: str = 'SerperAPIToolkit', api_key: Optional[str] = None, num_search_pages: Optional[int] = 10, max_content_words: Optional[int] = None, default_location: Optional[str] = None, default_language: Optional[str] = 'en', default_country: Optional[str] = 'us', enable_content_scraping: Optional[bool] = True, **kwargs)
Bases: Toolkit
Initialize SerperAPI Toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'SerperAPIToolkit'
|
api_key
|
str
|
SerperAPI authentication key |
None
|
num_search_pages
|
int
|
Default number of search results to retrieve |
10
|
max_content_words
|
int
|
Default maximum words per result content |
None
|
default_location
|
str
|
Default geographic location |
None
|
default_language
|
str
|
Default interface language |
'en'
|
default_country
|
str
|
Default country code |
'us'
|
enable_content_scraping
|
bool
|
Whether to enable content scraping |
True
|
**kwargs
|
Additional keyword arguments |
{}
|
Source code in evoagentx/tools/search_serperapi.py
SerpAPIToolkit ¶
SerpAPIToolkit(name: str = 'SerpAPIToolkit', api_key: Optional[str] = None, num_search_pages: Optional[int] = 5, max_content_words: Optional[int] = None, default_engine: Optional[str] = 'google', default_location: Optional[str] = None, default_language: Optional[str] = 'en', default_country: Optional[str] = 'us', enable_content_scraping: Optional[bool] = True, **kwargs)
Bases: Toolkit
Initialize SerpAPI Toolkit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the toolkit |
'SerpAPIToolkit'
|
api_key
|
str
|
SerpAPI authentication key |
None
|
num_search_pages
|
int
|
Default number of search results to retrieve |
5
|
max_content_words
|
int
|
Default maximum words per result content |
None
|
default_engine
|
str
|
Default search engine |
'google'
|
default_location
|
str
|
Default geographic location |
None
|
default_language
|
str
|
Default interface language |
'en'
|
default_country
|
str
|
Default country code |
'us'
|
enable_content_scraping
|
bool
|
Whether to enable content scraping |
True
|
**kwargs
|
Additional keyword arguments |
{}
|