haive.agents.planning.rewoo.models.tool_step ============================================ .. py:module:: haive.agents.planning.rewoo.models.tool_step .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: haive.agents.planning.rewoo.models.tool_step.ToolStep Functions --------- .. autoapisummary:: haive.agents.planning.rewoo.models.tool_step.create_tool_steps_from_plan haive.agents.planning.rewoo.models.tool_step.validate_tool_compatibility Module Contents --------------- .. py:class:: ToolStep(/, **data) Bases: :py:obj:`haive.agents.planning.rewoo.models.steps.AbstractStep` A step that executes a specific tool with validated arguments. 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. .. py:method:: can_execute(completed_steps) Check if this step can execute. .. py:method:: clear_tool_args() Clear all tool arguments. .. py:method:: create_from_tool(tool, tool_args, available_tools, description = None, **kwargs) :classmethod: Factory method to create ToolStep from a tool instance. .. py:method:: execute(context) Execute the tool with the provided arguments. .. py:method:: get_tool_info() Get comprehensive tool information. .. py:method:: update_tool_args(**kwargs) Update tool arguments and revalidate. .. py:method:: validate_tool_exists_and_args() Validate tool exists and arguments are correct. .. py:method:: validate_tool_name(v, info) :classmethod: Validate tool name exists in available tools. .. py:method:: validate_tools_not_empty(v) :classmethod: Validate tools list is not empty. .. py:property:: is_tool_valid :type: bool Whether the tool setup is valid. .. py:property:: optional_args :type: list[str] Optional arguments for the selected tool. .. py:property:: required_args :type: list[str] Required arguments for the selected tool. .. py:property:: selected_tool :type: langchain_core.tools.BaseTool | None The selected tool instance. .. py:property:: tool_names :type: list[str] List of available tool names. .. py:property:: tool_schema :type: dict[str, Any] | None Schema of the selected tool. .. py:function:: create_tool_steps_from_plan(tool_plan, available_tools) Create a list of ToolSteps from a plan description. .. py:function:: validate_tool_compatibility(tools) Validate a list of tools for compatibility issues.