Uses of Interface
dev.langchain4j.service.tool.ToolExecutionRound.Outcome
Packages that use ToolExecutionRound.Outcome
-
Uses of ToolExecutionRound.Outcome in dev.langchain4j.service.tool
Methods in dev.langchain4j.service.tool that return ToolExecutionRound.OutcomeModifier and TypeMethodDescriptionToolExecutionRound.complete(List<ToolExecutionRequest> calls) Completes the round once every call has been executed, and reports the calls as they were executed with their results.Methods in dev.langchain4j.service.tool that return types with arguments of type ToolExecutionRound.OutcomeModifier and TypeMethodDescriptionToolExecutionRound.completeAsync(List<ToolExecutionRequest> calls) Non-blocking counterpart ofToolExecutionRound.complete(List), for calls started withToolExecutionRound.startTool(ToolExecutionRequest, Consumer, Consumer, Executor): waits until every call has ended, normally or not, and reports them all.ToolExecutionRound.completeAsync(List<ToolExecutionRequest> calls, List<ToolExecutionRequest> aiMessageCalls) AsToolExecutionRound.completeAsync(List), for calls started before theAiMessagewas known (a streaming model announces each tool call before its final response), with requests that can differ from the ones of theAiMessage: a provider can give a call another id in its final response, or format its arguments differently.Methods in dev.langchain4j.service.tool with parameters of type ToolExecutionRound.OutcomeModifier and TypeMethodDescriptionvoidToolService.collectCompensableRound(ToolExecutionRound.Outcome round, List<ToolService.CompensableToolExecution> compensableExecutions, InvocationContext invocationContext) AsToolService.collectCompensableRound(List, Map, List, InvocationContext), for a completedToolExecutionRoundwhose calls may have gone through tool guardrails, before it is passed toToolService.compensateCollectedRoundAsync(ToolExecutionRound.Outcome, List, List, boolean, ChatMemory, List, InvocationContext, AiServiceListenerRegistrar, Consumer, Throwable).ToolService.compensateCollectedRoundAsync(ToolExecutionRound.Outcome round, List<ToolExecutionResultMessage> resultMessages, List<ToolService.CompensableToolExecution> compensableExecutions, boolean anyToolErrored, @Nullable ChatMemory chatMemory, @Nullable List<ChatMessage> messages, InvocationContext invocationContext, AiServiceListenerRegistrar listenerRegistrar, @Nullable Consumer<AiServiceStreamingEvent.ToolCompensatedEvent> streamEventEmitter, @Nullable Throwable invocationError) Non-blocking counterpart ofToolService.compensateIfNeeded(List, Map, List, List, boolean, ChatMemory, List, InvocationContext, AiServiceListenerRegistrar), used by theCompletableFutureand reactive modes, for a completedToolExecutionRoundwhose compensable tools were already collected withToolService.collectCompensableRound(ToolExecutionRound.Outcome, List, InvocationContext).voidToolService.compensateIfNeeded(ToolExecutionRound.Outcome round, List<ToolExecutionResultMessage> resultMessages, @Nullable List<ToolService.CompensableToolExecution> compensableExecutions, boolean anyToolErrored, @Nullable ChatMemory chatMemory, @Nullable List<ChatMessage> messages, InvocationContext invocationContext, AiServiceListenerRegistrar listenerRegistrar) AsToolService.compensateIfNeeded(List, Map, List, List, boolean, ChatMemory, List, InvocationContext, AiServiceListenerRegistrar), for a completedToolExecutionRound, whose calls may have gone through tool guardrails: whether a tool is compensable, and the result its compensating action gets, are the ones of the tool as it ran, and the reason of theToolCompensatedEvents tells whether a tool guardrail made the step fail.voidToolService.compensateOnCancellation(ToolExecutionRound.Outcome currentRound, @Nullable List<ToolExecutionRequest> unsavedRequests, @Nullable List<ToolService.CompensableToolExecution> compensableExecutions, @Nullable ChatMemory chatMemory, InvocationContext invocationContext, AiServiceListenerRegistrar listenerRegistrar) Blocking counterpart ofToolService.compensateOnCancellationAsync(ToolExecutionRound.Outcome, List, List, ChatMemory, List, InvocationContext, AiServiceListenerRegistrar), used by theTokenStreammode, which uses the chat memory synchronously: rolls back, on cancellation, every compensable tool that had already executed successfully, across all rounds, on the calling thread.ToolService.compensateOnCancellationAsync(@Nullable ToolExecutionRound.Outcome currentRound, @Nullable List<ToolExecutionRequest> unsavedRequests, @Nullable List<ToolService.CompensableToolExecution> compensableExecutions, @Nullable ChatMemory chatMemory, @Nullable List<ChatMessage> messages, InvocationContext invocationContext, AiServiceListenerRegistrar listenerRegistrar) Rolls back, on cancellation, every compensable tool that had already executed successfully - across all rounds - implementing the "drain the round, then roll back" contract for the asynchronous and reactive modes.ToolService.processToolResults(AiServiceContext context, ToolExecutionRound.Outcome round, List<ToolExecution> toolExecutions, InvocationContext invocationContext, ToolServiceContext toolServiceContext) AsToolService.processToolResults(AiServiceContext, List, Map, List, InvocationContext, ToolServiceContext), for a completedToolExecutionRound, whose calls may have gone through tool guardrails: a compensable tool is exposed for cross-agent compensation when it ran successfully, whatever its output guardrails made of the result, and with the result it ran with.