Package org.bsc.langgraph4j.action
Interface AsyncNodeAction<S extends AgentState>
- Type Parameters:
S
- the type of the agent state
- All Superinterfaces:
Function<S,
CompletableFuture<Map<String, Object>>>
- All Known Implementing Classes:
EvaluateResult
,EvaluateResult
,ReviewResult
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface AsyncNodeAction<S extends AgentState>
extends Function<S,CompletableFuture<Map<String,Object>>>
Represents an asynchronous node action that operates on an agent state and returns state update.
-
Method Summary
Modifier and TypeMethodDescriptionApplies this action to the given agent state.static <S extends AgentState>
AsyncNodeAction<S>node_async
(NodeAction<S> syncAction) Creates an asynchronous node action from a synchronous node action.
-
Method Details
-
apply
Applies this action to the given agent state.- Specified by:
apply
in interfaceFunction<S extends AgentState,
CompletableFuture<Map<String, Object>>> - Parameters:
t
- the agent state- Returns:
- a CompletableFuture representing the result of the action
-
node_async
Creates an asynchronous node action from a synchronous node action.- Type Parameters:
S
- the type of the agent state- Parameters:
syncAction
- the synchronous node action- Returns:
- an asynchronous node action
-