Interface AgentPlatform
-
- All Implemented Interfaces:
-
com.embabel.agent.core.ActionSource,com.embabel.agent.core.AgentScope,com.embabel.agent.core.ConditionSource,com.embabel.agent.core.DataDictionary,com.embabel.agent.core.GoalSource,com.embabel.common.core.types.Described,com.embabel.common.core.types.HasInfoString,com.embabel.common.core.types.Named
public interface AgentPlatform implements AgentScope
An AgentPlatform can run agents. It can also act as an agent itself, drawing on all of its agents as its own actions, goals, and conditions. An AgentPlatform is stateful, as agents can be deployed to it. See TypedOps for a higher level API with typed I/O. Typically, there is one AgentPlatform per Spring Boot application, with agents discovered by classpath scanning for @Agent annotations, but this is not a requirement.
-
-
Method Summary
Modifier and Type Method Description abstract AgentProcessgetAgentProcess(String id)Find an agent process by id. abstract AgentProcesskillAgentProcess(String id)Kill an agent process by id. abstract List<Agent>agents()abstract AgentPlatformdeploy(Agent agent)AgentPlatformdeploy(AgentScope agentScope)abstract AgentProcessrunAgentFrom(Agent agent, ProcessOptions processOptions, Map<String, Object> bindings)Run the agent from the given ProcessOptions. abstract AgentProcesscreateAgentProcess(Agent agent, ProcessOptions processOptions, Map<String, Object> bindings)Create an agent process with the given options and bindings. AgentProcesscreateAgentProcessFrom(Agent agent, ProcessOptions processOptions, Object objectsToAdd)Create an agent process with the given options and bind all arguments. CompletableFuture<AgentProcess>start(AgentProcess agentProcess)Run the given agent process in the background abstract AgentProcesscreateChildProcess(Agent agent, AgentProcess parentAgentProcess)abstract PlatformServicesgetPlatformServices()abstract ToolGroupResolvergetToolGroupResolver()Collection<DomainType>getDomainTypes()List<Action>getActions()Set<Goal>getGoals()Set<Condition>getConditions()-
Methods inherited from class com.embabel.agent.core.AgentScope
createAgent, getOpaque, infoString, resolveType -
Methods inherited from class com.embabel.agent.core.DataDictionary
allowedRelationships, domainTypeForLabels, getDynamicTypes, getJvmTypes -
Methods inherited from class com.embabel.common.core.types.Named
getName -
Methods inherited from class com.embabel.common.core.types.Described
getDescription -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getAgentProcess
abstract AgentProcess getAgentProcess(String id)
Find an agent process by id. Implementations are only obliged to resolve running processes, although they may choose to return older processes.
-
killAgentProcess
abstract AgentProcess killAgentProcess(String id)
Kill an agent process by id. Return the killed process, or null if no such process was found.
-
deploy
abstract AgentPlatform deploy(Agent agent)
-
deploy
AgentPlatform deploy(AgentScope agentScope)
-
runAgentFrom
abstract AgentProcess runAgentFrom(Agent agent, ProcessOptions processOptions, Map<String, Object> bindings)
Run the agent from the given ProcessOptions. We might create a new blackboard or have one
- Parameters:
agent- the agent to run.processOptions- the options for the processbindings- the bindings for the process: Objects that are pre-bound to the blackboard.
-
createAgentProcess
abstract AgentProcess createAgentProcess(Agent agent, ProcessOptions processOptions, Map<String, Object> bindings)
Create an agent process with the given options and bindings. The process will not be started automatically, so this will return quickly, unlike the run method on the created process. AgentProcess status will be NOT_STARTED.
- Parameters:
agent- the agent to run.processOptions- the options for the processbindings- the bindings for the process: Objects that are pre-bound to the blackboard.
-
createAgentProcessFrom
AgentProcess createAgentProcessFrom(Agent agent, ProcessOptions processOptions, Object objectsToAdd)
Create an agent process with the given options and bind all arguments.
- Parameters:
agent- the agent to run.processOptions- the options for the processobjectsToAdd- the objects to add to the blackboard.
-
start
CompletableFuture<AgentProcess> start(AgentProcess agentProcess)
Run the given agent process in the background
-
createChildProcess
abstract AgentProcess createChildProcess(Agent agent, AgentProcess parentAgentProcess)
-
getPlatformServices
abstract PlatformServices getPlatformServices()
-
getToolGroupResolver
abstract ToolGroupResolver getToolGroupResolver()
-
getDomainTypes
Collection<DomainType> getDomainTypes()
-
getActions
List<Action> getActions()
-
getConditions
Set<Condition> getConditions()
-
-
-
-