tooluniverse.url_tool module¶
- class tooluniverse.url_tool.URLHTMLTagTool[source]¶
Bases:
BaseTool
Fetches a webpage and extracts the content of a specified HTML tag. Expects: {“url”: “https://…”} The tag to extract is specified in the tool’s configuration. The tag to extract is specified in the tool’s configuration. Optional: {“timeout”: <seconds>} (default 20) Returns: {“content”: “<extracted content>”} or {“error”: “…”}
- run(arguments)[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.
- class tooluniverse.url_tool.URLToPDFTextTool[source]¶
Bases:
BaseTool
Loads a webpage (with JavaScript), exports it as a PDF, and extracts text. Expects: {“url”: “https://…”} Optional: {“timeout”: <seconds>} (default 30) Returns: {“text”: “<extracted text>”} or {“error”: “…”}
- run(arguments)[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.