Class ConditionalReplanningTool

  • All Implemented Interfaces:
    com.embabel.agent.api.tool.DelegatingTool , com.embabel.agent.api.tool.Tool , com.embabel.agent.api.tool.ToolInfo

    
    public final class ConditionalReplanningTool
     implements DelegatingTool
                        

    Tool decorator that executes the wrapped tool, then conditionally triggers replanning based on the result.

    Unlike ReplanningTool which always triggers replanning, this tool allows the ReplanDecider to inspect the result and decide whether to replan.

    Note: This tool accesses AgentProcess via thread-local at call time, which is set by the decorator chain.

    • Constructor Detail

      • ConditionalReplanningTool

        ConditionalReplanningTool(Tool delegate, ReplanDecider decider)
        Parameters:
        delegate - The tool to wrap
        decider - Decider that inspects the result context and determines whether to replan