pig/agent/step_result
Step result type for the sans-IO core.
The outcome of a single state transition — what happened after processing a message. Carries the new state and optional effects.
Three variants:
Done— the agent produced a final answerContinue— the agent needs more work (inference, tools)Failed— an unrecoverable error occurred
Types
Result of a single state transition in the agent loop.
pub type StepResult(msg) {
Done(state: state.AgentState, message: message.Message)
Continue(
state: state.AgentState,
effects: List(effect.Effect(msg)),
)
Failed(state: state.AgentState, error: error.AiError)
}
Constructors
-
Done(state: state.AgentState, message: message.Message)The agent produced a final answer. No further effects needed.
-
Continue( state: state.AgentState, effects: List(effect.Effect(msg)), )The agent needs more work. Contains effects for the runtime to execute.
-
Failed(state: state.AgentState, error: error.AiError)An unrecoverable error occurred.