Package com.embabel.agent.api.invocation
Class UtilityInvocation
-
- All Implemented Interfaces:
-
com.embabel.agent.api.invocation.BaseInvocation,com.embabel.agent.api.invocation.ScopedInvocation
public final class UtilityInvocation implements BaseInvocation<UtilityInvocation>, ScopedInvocation<UtilityInvocation>
Invoker for utility agents. Will pick up all @EmbabelComponent and @Agent annotated classes and apply all their actions and goals
-
-
Constructor Summary
Constructors Constructor Description UtilityInvocation(AgentPlatform agentPlatform, ProcessOptions processOptions, AgentScopeBuilder agentScopeBuilder)UtilityInvocation(AgentPlatform agentPlatform, ProcessOptions processOptions)UtilityInvocation(AgentPlatform agentPlatform)
-
Method Summary
Modifier and Type Method Description UtilityInvocationwithProcessOptions(ProcessOptions options)final UtilityInvocationterminateWhenStuck()Do we terminate the agent process without error if it gets stuck? UtilityInvocationwithScope(AgentScopeBuilder agentScopeBuilder)Set the scope of actions and goals CompletableFuture<AgentProcess>runAsync(Object obj, Object objs)Runs the agent asynchronously with one or more arguments CompletableFuture<AgentProcess>runAsync(Map<String, Object> map)Runs the agent asynchronously with a map of named inputs. final AgentcreatePlatformAgent()Create a platform agent for utility invocations final static UtilityInvocationon(AgentPlatform agentPlatform)-
-
Constructor Detail
-
UtilityInvocation
UtilityInvocation(AgentPlatform agentPlatform, ProcessOptions processOptions, AgentScopeBuilder agentScopeBuilder)
- Parameters:
agentPlatform- the agent platform to create and manage agent processesprocessOptions- options to configure the agent processagentScopeBuilder- emits the scope to create the utility agent in
-
UtilityInvocation
UtilityInvocation(AgentPlatform agentPlatform, ProcessOptions processOptions)
- Parameters:
agentPlatform- the agent platform to create and manage agent processesprocessOptions- options to configure the agent process
-
UtilityInvocation
UtilityInvocation(AgentPlatform agentPlatform)
- Parameters:
agentPlatform- the agent platform to create and manage agent processes
-
-
Method Detail
-
withProcessOptions
UtilityInvocation withProcessOptions(ProcessOptions options)
-
terminateWhenStuck
final UtilityInvocation terminateWhenStuck()
Do we terminate the agent process without error if it gets stuck?
-
withScope
UtilityInvocation withScope(AgentScopeBuilder agentScopeBuilder)
Set the scope of actions and goals
-
runAsync
CompletableFuture<AgentProcess> runAsync(Object obj, Object objs)
Runs 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:
the future agent process
-
runAsync
CompletableFuture<AgentProcess> runAsync(Map<String, Object> map)
Runs the agent asynchronously with a map of named inputs.
- Parameters:
map- A Map that initializes the blackboard- Returns:
the future agent process
-
createPlatformAgent
final Agent createPlatformAgent()
Create a platform agent for utility invocations
-
on
final static UtilityInvocation on(AgentPlatform agentPlatform)
-
-
-
-