Package com.embabel.agent.core.hitl
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).
-
-
Field Summary
Fields Modifier and Type Field Description private final Tool.Definitiondefinitionprivate final Tool.Metadatametadataprivate final Tooldelegate
-
Constructor Summary
Constructors Constructor Description ConfirmingTool(Tool delegate, Function1<String, String> messageProvider)
-
Method Summary
Modifier and Type Method Description Tool.DefinitiongetDefinition()Tool definition for LLM Tool.MetadatagetMetadata()Optional metadata ToolgetDelegate()Tool.Resultcall(String input)Execute the tool with JSON input. -
-
Method Detail
-
getDefinition
Tool.Definition getDefinition()
Tool definition for LLM
-
getMetadata
Tool.Metadata getMetadata()
Optional metadata
-
getDelegate
Tool getDelegate()
-
call
Tool.Result call(String input)
Execute the tool with JSON input.
- Parameters:
input- JSON string matching inputSchema- Returns:
Result to send back to LLM
-
-
-
-