tooluniverse.agentic_tool module

class tooluniverse.agentic_tool.datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])[source][source]

Bases: date

The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints.

hour[source]
minute[source]
second[source]
microsecond[source]
tzinfo[source]
fold[source]
fromtimestamp()[source]

timestamp[, tz] -> tz’s local time from POSIX timestamp.

utcfromtimestamp()[source]

Construct a naive UTC datetime from a POSIX timestamp.

now()[source]

Returns new datetime object representing current time local to tz.

tz

Timezone object.

If no tz is specified, uses local timezone.

utcnow()[source]

Return a new datetime representing UTC day and time.

combine()[source]

date, time -> datetime with same date and time fields

fromisoformat()[source]

string -> datetime from datetime.isoformat() output

timetuple()[source]

Return time tuple, compatible with time.localtime().

timestamp()[source]

Return POSIX timestamp as float.

utctimetuple()[source]

Return UTC time tuple, compatible with time.localtime().

date()[source]

Return date object with same year, month and day.

time()[source]

Return time object with same time but with tzinfo=None.

timetz()[source]

Return time object with same time and tzinfo.

replace()[source]

Return datetime with new specified fields.

astimezone()[source]

tz -> convert to local time in new timezone tz

ctime()[source]

Return ctime() style string.

isoformat()[source]

[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’ and ‘microseconds’.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

strptime()[source]

string, format -> new datetime parsed from a string (like time.strptime()).

utcoffset()[source]

Return self.tzinfo.utcoffset(self).

tzname()[source]

Return self.tzinfo.tzname(self).

dst()[source]

Return self.tzinfo.dst(self).

max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)[source]
min = datetime.datetime(1, 1, 1, 0, 0)[source]
resolution = datetime.timedelta(microseconds=1)[source]
class tooluniverse.agentic_tool.BaseTool(tool_config)[source][source]

Bases: object

__init__(tool_config)[source][source]
classmethod get_default_config_file()[source][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

classmethod load_defaults_from_file()[source][source]

Load defaults from the configuration file

run(arguments=None)[source][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.

check_function_call(function_call_json)[source][source]
get_required_parameters()[source][source]

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

tooluniverse.agentic_tool.register_tool(tool_type_name=None, config=None)[source][source]

Decorator to automatically register tool classes and their configs.

Usage:

@register_tool(‘CustomToolName’, config={…}) class MyTool:

pass

tooluniverse.agentic_tool.get_logger(name: str | None = None) Logger[source][source]

Get a logger instance

Parameters:

name (str, optional) – Logger name (usually __name__)

Returns:

Logger instance

Return type:

logging.Logger

class tooluniverse.agentic_tool.AzureOpenAIClient(model_id: str, api_version: str | None, logger)[source][source]

Bases: BaseLLMClient

DEFAULT_MODEL_LIMITS: Dict[str, Dict[str, int]] = {'embedding-ada': {'context_window': 8192, 'max_output': 8192}, 'gpt-4.1': {'context_window': 1047576, 'max_output': 32768}, 'gpt-4.1-mini': {'context_window': 1047576, 'max_output': 32768}, 'gpt-4.1-nano': {'context_window': 1047576, 'max_output': 32768}, 'gpt-4o': {'context_window': 128000, 'max_output': 16384}, 'gpt-4o-0806': {'context_window': 128000, 'max_output': 16384}, 'gpt-4o-1120': {'context_window': 128000, 'max_output': 16384}, 'gpt-4o-mini-0718': {'context_window': 128000, 'max_output': 16384}, 'o3-mini': {'context_window': 200000, 'max_output': 100000}, 'o3-mini-0131': {'context_window': 200000, 'max_output': 100000}, 'o4-mini': {'context_window': 200000, 'max_output': 100000}, 'o4-mini-0416': {'context_window': 200000, 'max_output': 100000}, 'text-embedding-3-large': {'context_window': 8192, 'max_output': 8192}, 'text-embedding-3-small': {'context_window': 8192, 'max_output': 8192}}[source]
__init__(model_id: str, api_version: str | None, logger)[source][source]
test_api() None[source][source]
infer(messages: List[Dict[str, str]], temperature: float | None, max_tokens: int | None, return_json: bool, custom_format: Any | None = None, max_retries: int = 5, retry_delay: int = 5) str | None[source][source]
class tooluniverse.agentic_tool.GeminiClient(model_name: str, logger)[source][source]

Bases: BaseLLMClient

__init__(model_name: str, logger)[source][source]
test_api() None[source][source]
infer(messages: List[Dict[str, str]], temperature: float | None, max_tokens: int | None, return_json: bool, custom_format: Any | None = None, max_retries: int = 5, retry_delay: int = 5) str | None[source][source]
class tooluniverse.agentic_tool.AgenticTool(tool_config: Dict[str, Any])[source][source]

Bases: BaseTool

Generic wrapper around LLM prompting supporting JSON-defined configs with prompts and input arguments.

static has_any_api_keys() bool[source][source]

Check if any API keys are available across all supported API types.

Returns:

True if at least one API type has all required keys, False otherwise

Return type:

bool

__init__(tool_config: Dict[str, Any])[source][source]
run(arguments: Dict[str, Any]) Dict[str, Any][source][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.

get_prompt_preview(arguments: Dict[str, Any]) str[source][source]
get_model_info() Dict[str, Any][source][source]
is_available() bool[source][source]

Check if the tool is available for use.

get_availability_status() Dict[str, Any][source][source]

Get detailed availability status of the tool.

retry_initialization() bool[source][source]

Attempt to reinitialize the tool (useful if API keys were updated).

get_prompt_template() str[source][source]
get_input_arguments() List[str][source][source]
validate_configuration() Dict[str, Any][source][source]
estimate_token_usage(arguments: Dict[str, Any]) Dict[str, int][source][source]