Class PendingResponse<T>
java.lang.Object
dev.langchain4j.agentic.internal.DeferredResponse<T>
dev.langchain4j.agentic.internal.PendingResponse<T>
- Type Parameters:
T- the type of the response value
- All Implemented Interfaces:
DelayedResponse<T>
A
DeferredResponse that blocks the calling thread until completed.
When the agentic system encounters this response via readState(), the calling thread
blocks on the underlying CompletableFuture until
DeferredResponse.complete(Object) is called externally. This is the default behavior for
human-in-the-loop agents that do not require crash-resilient suspension.
Usage with HumanInTheLoop:
HumanInTheLoop.builder()
.responseProvider(scope -> new PendingResponse<>("user-approval"))
.build();
// From another thread:
scope.completePendingResponse("user-approval", "approved");
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class DeferredResponse
blockingGet, blockingGet, complete, completeExceptionally, isDone, responseId, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface DelayedResponse
result
-
Constructor Details
-
PendingResponse
-