Interface AgentProcess
-
- All Implemented Interfaces:
-
com.embabel.agent.core.Bindable,com.embabel.agent.core.Blackboard,com.embabel.agent.core.LlmInvocationHistory,com.embabel.agent.core.MayHaveLastResult,com.embabel.agent.core.OperationStatus,com.embabel.common.core.types.HasInfoString,com.embabel.common.core.types.Timed,com.embabel.common.core.types.Timestamped
public interface AgentProcess implements Blackboard, Timestamped, Timed, OperationStatus<AgentProcessStatusCode>, LlmInvocationHistory
Run of an agent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAgentProcess.Companion
-
Method Summary
Modifier and Type Method Description AgentProcessStatusReportstatusReport()Return a serializable status report for this process. abstract ProcessKilledEventkill()Kill this process and return an event describing the kill if we are successful abstract UnitrecordLlmInvocation(LlmInvocation llmInvocation)abstract AgentProcesstick()Perform the next step only. abstract AgentProcessrun()Run the process as far as we can. <O extends Any> OresultOfType(Class<O> outputClass)abstract StringgetId()Unique id of this process abstract StringgetParentId()abstract Planner<?, ?, ?>getPlanner()Get the planner for this process abstract List<ActionInvocation>getHistory()abstract GoalgetGoal()Goal of this process. BooleangetFinished()abstract ObjectgetFailureInfo()If we failed, this may contain the reason for the failure. abstract WorldStategetLastWorldState()The last world state that was used to plan the next action Will be non-null if the process is running abstract ProcessContextgetProcessContext()abstract AgentgetAgent()The agent that this process is running. DurationgetRunningTime()-
Methods inherited from class com.embabel.agent.core.Blackboard
count, expressionEvaluationModel, get, getBlackboardId, getCondition, getObjects, getOrPut, getValue, hasValue, hide, last, lastResult, objectsOfType, setCondition, spawn -
Methods inherited from class com.embabel.agent.core.Bindable
addAll, addObject, bind, bindAll, plusAssign, plusAssign, plusAssign, set -
Methods inherited from class com.embabel.common.core.types.HasInfoString
infoString -
Methods inherited from class com.embabel.agent.core.LlmInvocationHistory
cost, costInfoString, getLlmInvocations, getToolsStats, modelsUsed, usage -
Methods inherited from class com.embabel.common.core.types.Timestamped
getTimestamp -
Methods inherited from class com.embabel.agent.core.OperationStatus
getStatus -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
statusReport
AgentProcessStatusReport statusReport()
Return a serializable status report for this process.
-
kill
abstract ProcessKilledEvent kill()
Kill this process and return an event describing the kill if we are successful
-
recordLlmInvocation
abstract Unit recordLlmInvocation(LlmInvocation llmInvocation)
-
tick
abstract AgentProcess tick()
Perform the next step only. Return when an action has been completed and the process is ready to plan, regardless of the result of the action.
- Returns:
status code of the action. Side effects may have occurred in Blackboard
-
run
abstract AgentProcess run()
Run the process as far as we can. Might complete, fail, get stuck or hit a waiting state. This is a slow operation. We may wish to run this async. Events will be emitted as the process runs, so we can track progress.
- Returns:
status code of the process. Side effects may have occurred in Blackboard
-
resultOfType
<O extends Any> O resultOfType(Class<O> outputClass)
-
getParentId
abstract String getParentId()
-
getPlanner
abstract Planner<?, ?, ?> getPlanner()
Get the planner for this process
-
getHistory
abstract List<ActionInvocation> getHistory()
-
getFinished
Boolean getFinished()
-
getFailureInfo
abstract Object getFailureInfo()
If we failed, this may contain the reason for the failure.
-
getLastWorldState
abstract WorldState getLastWorldState()
The last world state that was used to plan the next action Will be non-null if the process is running
-
getProcessContext
abstract ProcessContext getProcessContext()
-
getAgent
abstract Agent getAgent()
The agent that this process is running. Many processes can run the same agent.
-
getRunningTime
Duration getRunningTime()
-
-
-
-