Uses of Interface
dev.langchain4j.service.tool.ToolExecutionErrorHandler
Packages that use ToolExecutionErrorHandler
Package
Description
-
Uses of ToolExecutionErrorHandler in dev.langchain4j.agentic.agent
Methods in dev.langchain4j.agentic.agent with parameters of type ToolExecutionErrorHandlerModifier and TypeMethodDescriptionAgentBuilder.toolExecutionErrorHandler(ToolExecutionErrorHandler toolExecutionErrorHandler) Sets the handler invoked when a tool execution throws an exception. -
Uses of ToolExecutionErrorHandler in dev.langchain4j.service
Methods in dev.langchain4j.service that return ToolExecutionErrorHandlerMethods in dev.langchain4j.service with parameters of type ToolExecutionErrorHandlerModifier and TypeMethodDescriptionAiServices.toolExecutionErrorHandler(ToolExecutionErrorHandler handler) Configures the handler to be invoked when errors occur during tool execution.AiServiceTokenStreamParameters.Builder.toolExecutionErrorHandler(ToolExecutionErrorHandler handler) -
Uses of ToolExecutionErrorHandler in dev.langchain4j.service.tool
Methods in dev.langchain4j.service.tool that return ToolExecutionErrorHandlerModifier and TypeMethodDescriptionToolService.asyncExecutionErrorHandler()TheToolExecutionErrorHandlerfor the asynchronous AI Service modes (CompletableFuture, reactiveFlow.Publisher): a user-configured handler if present, otherwise the async default, which fails the AI Service invocation (rather than hiding the error from the developer by sending it to the LLM).ToolService.executionErrorHandler()static ToolExecutionErrorHandlerToolExecutionErrorHandler.failInvocation()Returns a handler that rethrows the error, failing the AI Service invocation.static ToolExecutionErrorHandlerToolExecutionErrorHandler.failInvocationUnlessVisibleToLlm()Returns a handler that sendsToolErrorVisibleToLlm.messageForLlm()to the LLM when the tool threw an exception implementingToolErrorVisibleToLlm, and fails the AI Service invocation for every other exception.static ToolExecutionErrorHandlerToolExecutionErrorHandler.sendExceptionMessageToLlm()Returns a handler that sends the message of the error to the LLM as the result of the tool execution, giving the LLM a chance to react to it (for example, by trying another tool or by telling the user what went wrong).static ToolExecutionErrorHandlerToolExecutionErrorHandler.sendGenericMessageToLlmUnlessVisibleToLlm(String genericMessage) Returns a handler that sendsToolErrorVisibleToLlm.messageForLlm()to the LLM when the tool threw an exception implementingToolErrorVisibleToLlm, and the given generic message for every other exception.Methods in dev.langchain4j.service.tool with parameters of type ToolExecutionErrorHandlerModifier and TypeMethodDescriptionstatic ToolExecutionResultToolService.executeWithErrorHandling(ToolExecutionRequest toolRequest, ToolExecutor toolExecutor, InvocationContext invocationContext, ToolArgumentsErrorHandler argumentsErrorHandler, ToolExecutionErrorHandler executionErrorHandler) voidToolService.executionErrorHandler(ToolExecutionErrorHandler handler)