Package dev.langchain4j.service.tool
package dev.langchain4j.service.tool
-
ClassDescriptionRepresents a tool managed by an AI Service, combining:
ToolSpecification— what is sent to the LLMToolExecutor— what is called when the LLM invokes the tool Metadata that controls how the AI Service handles this tool (e.g.,ReturnBehavior)AToolProviderthat passes on only the tools of another tool provider that are relevant to the conversation, as decided by aDecisionModel.What the tool provider does when the decision model fails.Handler forToolArgumentsExceptions thrown by aToolExecutor.Represents the execution of a tool, including the request and the result.Handler forToolExecutionExceptions thrown by aToolExecutor.Deprecated.Represents the result of a tool execution.One round of tool execution: the tool calls of oneAiMessage, in every AI service mode (blocking,CompletableFuture,TokenStream, reactive).A completed round: the calls as they were executed, in the order of the LLM, the result of each call, and the first failure of a call, if any.A low-level executor/handler of aToolExecutionRequest.A tool provider.The results of a round of tool executions, keeping successful and failed tools together so the caller can compensate the tools that did succeed before failing the invocation with the tool error.A compensable tool that ran: the execution its compensating action gets, with the result of the tool as it ran (before its output guardrails, which may have redacted what the undo needs), and the execution its compensation events carry, with the guarded result (after the output guardrails, as in theToolExecutedEvent, and without the note of an input rewrite).
ToolArgumentsParserinstead.