tooluniverse.agentic_tool moduleΒΆ
- class tooluniverse.agentic_tool.AgenticTool[source]ΒΆ
Bases:
BaseTool
Generic wrapper around LLM prompting supporting JSON-defined configs with prompts and input arguments.
- STREAM_FLAG_KEY = '_tooluniverse_stream'ΒΆ
- static has_any_api_keys()[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:
- _get_global_fallback_chain()[source]ΒΆ
Get the global fallback chain from environment or use default.
- _try_initialize_api()[source]ΒΆ
Try to initialize the primary API, fallback to secondary if configured.
- run(arguments, stream_callback=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.
- Parameters:
arguments (
dict, optional
) β Tool-specific argumentsstream_callback (
callable, optional
) β Callback for streaming responsesuse_cache (
bool, optional
) β Whether result caching is enabledvalidate (
bool, optional
) β Whether parameter validation was performed
Note
These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.
For backward compatibility, tools that donβt accept these parameters will still work - they will only receive the arguments parameter.