Uses of Enum Class
dev.langchain4j.observability.api.event.CompensationReason
Packages that use CompensationReason
Package
Description
-
Uses of CompensationReason in dev.langchain4j.observability.api.event
Subclasses with type arguments of type CompensationReason in dev.langchain4j.observability.api.eventModifier and TypeClassDescriptionenumWhy a successfully-executed tool was compensated (rolled back).Methods in dev.langchain4j.observability.api.event that return CompensationReasonModifier and TypeMethodDescriptionToolCompensatedEvent.reason()Returns why the tool was compensated.ToolCompensatedEvent.ToolCompensatedEventBuilder.reason()static CompensationReasonReturns the enum constant of this class with the specified name.static CompensationReason[]CompensationReason.values()Returns an array containing the constants of this enum class, in the order they are declared.Methods in dev.langchain4j.observability.api.event with parameters of type CompensationReasonModifier and TypeMethodDescriptionToolCompensatedEvent.ToolCompensatedEventBuilder.reason(CompensationReason reason) Sets the reason the tool was compensated. -
Uses of CompensationReason in dev.langchain4j.observability.event
Methods in dev.langchain4j.observability.event that return CompensationReason -
Uses of CompensationReason in dev.langchain4j.service
Methods in dev.langchain4j.service that return CompensationReasonConstructors in dev.langchain4j.service with parameters of type CompensationReasonModifierConstructorDescriptionToolCompensatedEvent(ToolExecution toolExecution, CompensationReason reason, InvocationContext invocationContext) -
Uses of CompensationReason in dev.langchain4j.service.tool
Methods in dev.langchain4j.service.tool with parameters of type CompensationReasonModifier and TypeMethodDescriptionToolService.compensateIfNeededAsync(List<ToolExecutionRequest> toolExecutionRequests, Map<ToolExecutionRequest, ToolExecutionResult> toolResults, List<ToolExecutionResultMessage> resultMessages, List<ToolService.CompensableToolExecution> compensableExecutions, boolean anyToolErrored, ChatMemory chatMemory, List<ChatMessage> messages, InvocationContext invocationContext, CompensationReason reason, AiServiceListenerRegistrar listenerRegistrar, BiConsumer<ToolExecution, CompensationReason> streamEmitter) Non-blocking counterpart ofToolService.compensateIfNeeded(List, Map, List, List, boolean, ChatMemory, List, InvocationContext, AiServiceListenerRegistrar), used by theCompletableFutureand reactive modes.ToolService.compensateIfNeededAsync(List<ToolExecutionRequest> toolExecutionRequests, Map<ToolExecutionRequest, ToolExecutionResult> toolResults, List<ToolExecutionResultMessage> resultMessages, List<ToolService.CompensableToolExecution> compensableExecutions, boolean anyToolErrored, ChatMemory chatMemory, List<ChatMessage> messages, InvocationContext invocationContext, CompensationReason reason, AiServiceListenerRegistrar listenerRegistrar, BiConsumer<ToolExecution, CompensationReason> streamEmitter, boolean alreadyCollected, String preCollectedFailedToolName) AsToolService.compensateIfNeededAsync(List, Map, List, List, boolean, ChatMemory, List, InvocationContext, CompensationReason, AiServiceListenerRegistrar, BiConsumer), but whenalreadyCollectedistruethis round's compensable tools have already been recorded intocompensableExecutions(viaToolService.collectCompensableRound(List, Map, List, InvocationContext)) andpreCollectedFailedToolNamecarries the collect's result; the collection step is then skipped.Method parameters in dev.langchain4j.service.tool with type arguments of type CompensationReasonModifier and TypeMethodDescriptionToolService.compensateIfNeededAsync(List<ToolExecutionRequest> toolExecutionRequests, Map<ToolExecutionRequest, ToolExecutionResult> toolResults, List<ToolExecutionResultMessage> resultMessages, List<ToolService.CompensableToolExecution> compensableExecutions, boolean anyToolErrored, ChatMemory chatMemory, List<ChatMessage> messages, InvocationContext invocationContext, CompensationReason reason, AiServiceListenerRegistrar listenerRegistrar, BiConsumer<ToolExecution, CompensationReason> streamEmitter) Non-blocking counterpart ofToolService.compensateIfNeeded(List, Map, List, List, boolean, ChatMemory, List, InvocationContext, AiServiceListenerRegistrar), used by theCompletableFutureand reactive modes.ToolService.compensateIfNeededAsync(List<ToolExecutionRequest> toolExecutionRequests, Map<ToolExecutionRequest, ToolExecutionResult> toolResults, List<ToolExecutionResultMessage> resultMessages, List<ToolService.CompensableToolExecution> compensableExecutions, boolean anyToolErrored, ChatMemory chatMemory, List<ChatMessage> messages, InvocationContext invocationContext, CompensationReason reason, AiServiceListenerRegistrar listenerRegistrar, BiConsumer<ToolExecution, CompensationReason> streamEmitter, boolean alreadyCollected, String preCollectedFailedToolName) AsToolService.compensateIfNeededAsync(List, Map, List, List, boolean, ChatMemory, List, InvocationContext, CompensationReason, AiServiceListenerRegistrar, BiConsumer), but whenalreadyCollectedistruethis round's compensable tools have already been recorded intocompensableExecutions(viaToolService.collectCompensableRound(List, Map, List, InvocationContext)) andpreCollectedFailedToolNamecarries the collect's result; the collection step is then skipped.ToolService.compensateOnCancellationAsync(List<ToolExecutionRequest> currentRoundRequests, Map<ToolExecutionRequest, ToolExecutionResult> currentRoundResults, List<ToolService.CompensableToolExecution> compensableExecutions, ChatMemory chatMemory, List<ChatMessage> messages, InvocationContext invocationContext, AiServiceListenerRegistrar listenerRegistrar, BiConsumer<ToolExecution, CompensationReason> streamEmitter) 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.