Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::tools::PythonTool Class Reference

Python execution tool that provides safe Python code execution capabilities. More...

#include <python_tool.h>

Inheritance diagram for agents::tools::PythonTool:
agents::Tool

Public Member Functions

 PythonTool ()
 Construct a new Python Tool object.
 
ToolResult execute (const JsonObject &params) const override
 Execute the Python tool.
 
const StringgetName () const
 Get the name of the tool.
 
const StringgetDescription () const
 Get the description of the tool.
 
const ParameterMapgetParameters () const
 Get the parameters of the tool.
 
const JsonObjectgetSchema () const
 Get the schema of the tool.
 
void addParameter (const Parameter &param)
 Add a parameter to the tool.
 
void setCallback (ToolCallback callback)
 Set the execution callback.
 
bool validateParameters (const JsonObject &params) const
 Validate parameters against schema.
 

Detailed Description

Python execution tool that provides safe Python code execution capabilities.

Member Function Documentation

◆ addParameter()

void agents::Tool::addParameter ( const Parameter & param)
inherited

Add a parameter to the tool.

Parameters
paramThe parameter to add

◆ execute()

ToolResult agents::tools::PythonTool::execute ( const JsonObject & params) const
overridevirtual

Execute the Python tool.

Parameters
paramsThe parameters for the Python tool
Returns
ToolResult The result of the Python tool

Reimplemented from agents::Tool.

◆ getDescription()

const String & agents::Tool::getDescription ( ) const
inherited

Get the description of the tool.

Returns
The description of the tool

◆ getName()

const String & agents::Tool::getName ( ) const
inherited

Get the name of the tool.

Returns
The name of the tool

◆ getParameters()

const ParameterMap & agents::Tool::getParameters ( ) const
inherited

Get the parameters of the tool.

Returns
The parameters of the tool

◆ getSchema()

const JsonObject & agents::Tool::getSchema ( ) const
inherited

Get the schema of the tool.

Returns
The schema of the tool

◆ setCallback()

void agents::Tool::setCallback ( ToolCallback callback)
inherited

Set the execution callback.

Parameters
callbackThe callback to set

◆ validateParameters()

bool agents::Tool::validateParameters ( const JsonObject & params) const
inherited

Validate parameters against schema.

Parameters
paramsThe parameters to validate
Returns
true of valid, otherwise false