fabricatio_tool.capabilities.use_tool
This module defines the UseToolBox class, which represents the usage of tools in a task.
It extends the UseLLM class and provides methods to manage and use toolboxes and tools within tasks.
Classes
A configuration class for tool usage. |
|
A class representing the usage of tools in a task. |
Module Contents
- class fabricatio_tool.capabilities.use_tool.ToolConfig(/, **data: Any)
Bases:
fabricatio_core.models.generic.ScopedConfigA configuration class for tool usage.
- toolboxes: Set[fabricatio_tool.models.tool.ToolBox] = None
A set of toolboxes used by the instance.
- class fabricatio_tool.capabilities.use_tool.UseTool(/, **data: Any)
Bases:
fabricatio_core.capabilities.usages.UseLLM,ToolConfig,abc.ABCA class representing the usage of tools in a task.
This class extends LLMUsage and provides methods to manage and use toolboxes and tools within tasks.
- async choose_toolboxes(request: str, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ChooseKwargs[fabricatio_tool.models.tool.ToolBox]]) List[fabricatio_tool.models.tool.ToolBox] | None
Asynchronously executes a multi-choice decision-making process to choose toolboxes.
- async choose_tools(request: str, toolbox: fabricatio_tool.models.tool.ToolBox, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ChooseKwargs[fabricatio_tool.models.tool.Tool]]) List[fabricatio_tool.models.tool.Tool] | None
Asynchronously executes a multi-choice decision-making process to choose tools.
- async gather_tools_fine_grind(request: str, box_choose_kwargs: fabricatio_core.models.kwargs_types.ChooseKwargs[fabricatio_tool.models.tool.ToolBox] | None = None, tool_choose_kwargs: fabricatio_core.models.kwargs_types.ChooseKwargs[fabricatio_tool.models.tool.Tool] | None = None) List[fabricatio_tool.models.tool.Tool]
Asynchronously gathers tools based on the provided request and toolbox and tool selection criteria.
- Parameters:
request (str) – The request for gathering tools.
box_choose_kwargs (Optional[ChooseKwargs]) – Keyword arguments for choosing toolboxes.
tool_choose_kwargs (Optional[ChooseKwargs]) – Keyword arguments for choosing tools.
- Returns:
A list of tools gathered based on the provided request and selection criteria.
- Return type:
List[Tool]
- async gather_tools(request: str, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ChooseKwargs[fabricatio_tool.models.tool.Tool]]) List[fabricatio_tool.models.tool.Tool]
Asynchronously gathers tools based on the provided request.
- Parameters:
request (str) – The request for gathering tools.
**kwargs (Unpack[ChooseKwargs]) – Keyword arguments for choosing tools.
- Returns:
A list of tools gathered based on the provided request.
- Return type:
List[Tool]