tooluniverse.base_tool moduleΒΆ

exception tooluniverse.base_tool.AuthenticationError[source]ΒΆ

Bases: Exception

Exception raised when authentication fails.

class tooluniverse.base_tool.BaseTool(tool_config)[source]ΒΆ

Bases: object

__init__(tool_config)[source]ΒΆ
_apply_defaults(tool_config)[source]ΒΆ

Apply default configuration to the tool config

check_function_call(function_call_json)[source]ΒΆ
classmethod get_default_config_file()[source]ΒΆ

Get the path to the default configuration file for this tool type.

This method uses a robust path resolution strategy that works across different installation scenarios:

  1. Installed packages: Uses importlib.resources for proper package resource access

  2. Development mode: Falls back to file-based path resolution

  3. Legacy Python: Handles importlib.resources and importlib_resources

Override this method in subclasses to specify a custom defaults file.

Returns:

Path or resource object pointing to the defaults file

get_required_parameters()[source]ΒΆ

Retrieve required parameters from the endpoint definition. Returns: list: List of required parameters for the given endpoint.

classmethod load_defaults_from_file()[source]ΒΆ

Load defaults from the configuration file

run(arguments=None)[source]ΒΆ

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

exception tooluniverse.base_tool.RateLimitError[source]ΒΆ

Bases: Exception

Exception raised when API rate limit is exceeded.

exception tooluniverse.base_tool.ToolExecutionError[source]ΒΆ

Bases: Exception

Base exception for tool execution errors.

exception tooluniverse.base_tool.ValidationError[source]ΒΆ

Bases: Exception

Exception raised when input validation fails.