agents.planning.rewoo.models.tool_step¶
Tool Step Model - Generic step that validates against a tool list.
A concrete step implementation that works with LangChain tools and validates: - Tool exists in provided tool list - Tool arguments match tool schema - Tool can be executed with given parameters
Classes¶
A step that executes a specific tool with validated arguments. |
Functions¶
|
Create a list of ToolSteps from a plan description. |
|
Validate a list of tools for compatibility issues. |
Module Contents¶
- class agents.planning.rewoo.models.tool_step.ToolStep¶
Bases:
agents.planning.rewoo.models.steps.AbstractStep
A step that executes a specific tool with validated arguments.
- can_execute(completed_steps)¶
Check if this step can execute.
- clear_tool_args()¶
Clear all tool arguments.
- Return type:
None
- classmethod create_from_tool(tool, tool_args, available_tools, description=None, **kwargs)¶
Factory method to create ToolStep from a tool instance.
- execute(context)¶
Execute the tool with the provided arguments.
- update_tool_args(**kwargs)¶
Update tool arguments and revalidate.
- Return type:
None
- validate_tool_exists_and_args()¶
Validate tool exists and arguments are correct.
- Return type:
- classmethod validate_tool_name(v, info)¶
Validate tool name exists in available tools.
- classmethod validate_tools_not_empty(v)¶
Validate tools list is not empty.
- agents.planning.rewoo.models.tool_step.create_tool_steps_from_plan(tool_plan, available_tools)¶
Create a list of ToolSteps from a plan description.