Class ConfirmingTool

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

    
    public final class ConfirmingTool
     implements DelegatingTool
                        

    Tool decorator that always requires confirmation before executing the delegate.

    When called, this tool throws AwaitableResponseException with a ConfirmationRequest. The framework handles the pause, the UX presents the confirmation, and if accepted, the tool is re-invoked (this time the confirmation is already satisfied via blackboard state).

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Tool.Definition getDefinition() Tool definition for LLM
      Tool.Metadata getMetadata() Optional metadata
      Tool getDelegate()
      Tool.Result call(String input) Execute the tool with JSON input.
      • Methods inherited from class com.embabel.agent.api.tool.Tool

        withDescription, withName, withNote
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfirmingTool

        ConfirmingTool(Tool delegate, Function1<String, String> messageProvider)
        Parameters:
        delegate - The tool to wrap
        messageProvider - Function to generate the confirmation message from input