haive.core.utils.tool_list¶
Tool list implementation for Haive Core.
This module provides specialized tool collection management and utilities.
Classes¶
A collection of tools that inherits from NamedDict. |
Module Contents¶
- class haive.core.utils.tool_list.ToolList(/, **data)[source]¶
Bases:
haive.core.utils.haive_collections.NamedDictA collection of tools that inherits from NamedDict.
Provides specialized handling for: - BaseTool classes and instances - BaseToolkit instances (automatically expands tools) - StructuredTool instances - Pydantic BaseModel classes (kept as classes) - Callable functions
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- get_tool(name)[source]¶
Get a tool by name.
- Parameters:
name (str) – Tool name
- Returns:
Tool if found, None otherwise
- Return type:
Any | None
- model_post_init(__context)[source]¶
Build tool type information after initialization.
- Return type:
None
- classmethod process_tools(data)[source]¶
Process tools input and expand toolkits.
- Parameters:
data (Any)
- Return type:
Any
- to_list()[source]¶
Convert to a simple list of tools.
- Returns:
List of all tools
- Return type:
list[Any]
- update(items)[source]¶
Update with new tools.
- Parameters:
items (Any) – Dictionary or sequence of tools
- Return type:
None
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].