ToolSet Class
A collection of tools that can be used by an synchronize agent.
Constructor
ToolSet()
Methods
| add |
Add a tool to the tool set. |
| execute_tool_calls |
Execute a tool of the specified type with the provided tool calls. |
| get_definitions_and_resources |
Get the definitions and resources for all tools in the tool set. |
| get_tool |
Get a tool of the specified type from the tool set. |
| remove |
Remove a tool of the specified type from the tool set. |
| validate_tool_type |
Validate the type of the tool. |
add
Add a tool to the tool set.
add(tool: Tool)
Parameters
| Name | Description |
|---|---|
|
tool
Required
|
The tool to add. |
Exceptions
| Type | Description |
|---|---|
|
If a tool of the same type already exists. |
execute_tool_calls
get_definitions_and_resources
get_tool
Get a tool of the specified type from the tool set.
get_tool(tool_type: Type[ToolT]) -> ToolT
Parameters
| Name | Description |
|---|---|
|
tool_type
Required
|
The type of tool to get. |
Returns
| Type | Description |
|---|---|
|
The tool of the specified type. |
Exceptions
| Type | Description |
|---|---|
|
If a tool of the specified type is not found. |
remove
Remove a tool of the specified type from the tool set.
remove(tool_type: Type[Tool]) -> None
Parameters
| Name | Description |
|---|---|
|
tool_type
Required
|
The type of tool to remove. |
Exceptions
| Type | Description |
|---|---|
|
If a tool of the specified type is not found. |
validate_tool_type
Validate the type of the tool.
validate_tool_type(tool: Tool) -> None
Parameters
| Name | Description |
|---|---|
|
tool
Required
|
The type of the tool to validate. |
Exceptions
| Type | Description |
|---|---|
|
If the tool type is not a subclass of Tool. |