Skip to content

Class swarmauri_core.toolkits.IToolkit.IToolkit

swarmauri_core.toolkits.IToolkit.IToolkit

Bases: ABC

A class representing a toolkit used by Swarm Agents. Tools are maintained in a dictionary keyed by the tool's name.

add_tools abstractmethod

add_tools(tools)

An abstract method that should be implemented by subclasses to add multiple tools to the toolkit.

Source code in swarmauri_core/toolkits/IToolkit.py
13
14
15
16
17
18
@abstractmethod
def add_tools(self, tools: Dict[str, ITool]) -> None:
    """
    An abstract method that should be implemented by subclasses to add multiple tools to the toolkit.
    """
    pass

add_tool abstractmethod

add_tool(tool)

An abstract method that should be implemented by subclasses to add a single tool to the toolkit.

Source code in swarmauri_core/toolkits/IToolkit.py
20
21
22
23
24
25
@abstractmethod
def add_tool(self, tool: ITool) -> None:
    """
    An abstract method that should be implemented by subclasses to add a single tool to the toolkit.
    """
    pass

remove_tool abstractmethod

remove_tool(tool_name)

An abstract method that should be implemented by subclasses to remove a tool from the toolkit by name.

Source code in swarmauri_core/toolkits/IToolkit.py
27
28
29
30
31
32
@abstractmethod
def remove_tool(self, tool_name: str) -> None:
    """
    An abstract method that should be implemented by subclasses to remove a tool from the toolkit by name.
    """
    pass

get_tool_by_name abstractmethod

get_tool_by_name(tool_name)

An abstract method that should be implemented by subclasses to retrieve a tool from the toolkit by name.

Source code in swarmauri_core/toolkits/IToolkit.py
34
35
36
37
38
39
@abstractmethod
def get_tool_by_name(self, tool_name: str) -> Optional[ITool]:
    """
    An abstract method that should be implemented by subclasses to retrieve a tool from the toolkit by name.
    """
    pass