orka.tools.base_tool module
Base Tool Module
This module defines the abstract base class for all tools in the OrKa framework. It establishes the core contract that all tool implementations must follow, ensuring consistent behavior and interoperability within orchestrated workflows.
The BaseTool class provides: - Common initialization parameters shared by all tools - Abstract interface definition through the run() method - Type identification via the tool’s class name - String representation for debugging and logging
- class orka.tools.base_tool.BaseTool(tool_id, prompt=None, queue=None, **kwargs)[source]
Bases:
ABC
Abstract base class for all tools in the OrKa framework. Defines the common interface and properties that all tools must implement.
- __init__(tool_id, prompt=None, queue=None, **kwargs)[source]
Initialize the base tool with common properties.
- Parameters:
tool_id (str) – Unique identifier for the tool.
prompt (str, optional) – Prompt or instruction for the tool.
queue (list, optional) – Queue of next tools to be processed.
**kwargs – Additional parameters specific to the tool type.
- abstractmethod run(input_data)[source]
Abstract method to run the tool’s functionality. Must be implemented by all concrete tool classes.
- Parameters:
input_data – Input data for the tool to process.
- Returns:
The result of the tool’s processing.
- Raises:
NotImplementedError – If not implemented by a subclass.