Class DefaultToolExecutionExceptionProcessor
java.lang.Object
org.springframework.ai.tool.execution.DefaultToolExecutionExceptionProcessor
- All Implemented Interfaces:
ToolExecutionExceptionProcessor
public class DefaultToolExecutionExceptionProcessor
extends Object
implements ToolExecutionExceptionProcessor
Default implementation of
ToolExecutionExceptionProcessor
. Can be configured
with an allowlist of exceptions that will be unwrapped from the
ToolExecutionException
and rethrown as is.- Since:
- 1.0.0
- Author:
- Thomas Vitale, Daniel Garnier-Moiroux
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefaultToolExecutionExceptionProcessor
(boolean alwaysThrow) DefaultToolExecutionExceptionProcessor
(boolean alwaysThrow, List<Class<? extends RuntimeException>> rethrownExceptions) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
process
(ToolExecutionException exception) Convert an exception thrown by a tool to a String that can be sent back to the AI model or throw an exception to be handled by the caller.
-
Constructor Details
-
DefaultToolExecutionExceptionProcessor
public DefaultToolExecutionExceptionProcessor(boolean alwaysThrow) -
DefaultToolExecutionExceptionProcessor
public DefaultToolExecutionExceptionProcessor(boolean alwaysThrow, List<Class<? extends RuntimeException>> rethrownExceptions)
-
-
Method Details
-
process
Description copied from interface:ToolExecutionExceptionProcessor
Convert an exception thrown by a tool to a String that can be sent back to the AI model or throw an exception to be handled by the caller.- Specified by:
process
in interfaceToolExecutionExceptionProcessor
-
builder
-