Package com.embabel.agent.api.invocation
Interface TypedInvocation
-
- All Implemented Interfaces:
-
com.embabel.agent.api.invocation.BaseInvocation
public interface TypedInvocation<T extends Object, THIS extends BaseInvocation<THIS>> implements BaseInvocation<THIS>
Defines the contract for invoking an agent with a specific return type.
Extends BaseInvocation to add typed invoke and invokeAsync methods that extract and return a result of type T from the completed agent process.
-
-
Method Summary
Modifier and Type Method Description Tinvoke(Object obj, Object objs)Invokes the agent with one or more arguments and returns the typed result. Tinvoke(Map<String, Object> map)Invokes the agent with a map of named inputs and returns the typed result. CompletableFuture<T>invokeAsync(Object obj, Object objs)Invokes the agent asynchronously with one or more arguments. CompletableFuture<T>invokeAsync(Map<String, Object> map)Invokes the agent asynchronously with a map of named inputs. abstract Class<T>getResultType()The class of the result type this invocation will produce. -
-
Method Detail
-
invoke
T invoke(Object obj, Object objs)
Invokes the agent with one or more arguments and returns the typed result.
- Parameters:
obj- the first (and possibly only) input value to be added to the blackboardobjs- additional input values to add to the blackboard- Returns:
the result of type T from the agent invocation
-
invoke
T invoke(Map<String, Object> map)
Invokes the agent with a map of named inputs and returns the typed result.
-
invokeAsync
CompletableFuture<T> invokeAsync(Object obj, Object objs)
Invokes the agent asynchronously with one or more arguments.
- Parameters:
obj- the first (and possibly only) input value to be added to the blackboardobjs- additional input values to add to the blackboard- Returns:
a future containing the result of type T
-
invokeAsync
CompletableFuture<T> invokeAsync(Map<String, Object> map)
Invokes the agent asynchronously with a map of named inputs.
-
getResultType
abstract Class<T> getResultType()
The class of the result type this invocation will produce.
-
-
-
-