Package com.embabel.agent.spi.support
Class ExceptionSuppressingTool
-
- All Implemented Interfaces:
-
com.embabel.agent.api.tool.Tool,com.embabel.agent.api.tool.ToolInfo,com.embabel.agent.spi.support.DelegatingTool
public final class ExceptionSuppressingTool implements DelegatingTool
Tool decorator that suppresses exceptions and returns a warning message instead.
Note: ReplanRequestedException is NOT suppressed - it is a control flow signal that must propagate to the tool loop to trigger replanning.
-
-
Field Summary
Fields Modifier and Type Field Description private final Tool.Definitiondefinitionprivate final Tool.Metadatametadataprivate final Tooldelegate
-
Constructor Summary
Constructors Constructor Description ExceptionSuppressingTool(Tool delegate)
-
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. -
-
Constructor Detail
-
ExceptionSuppressingTool
ExceptionSuppressingTool(Tool delegate)
-
-
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
-
-
-
-