runFromCheckpoint

suspend fun <Input, Output> runFromCheckpoint(agent: AIAgent<Input, Output>, input: Input, checkpoint: AgentCheckpointData, rollbackStrategy: RollbackStrategy = RollbackStrategy.Default, sessionId: String? = null): Output(source)

Runs the agent from a previously saved checkpoint.

Creates a new session and injects the checkpoint data into the session's storage so that the agent's graph strategy restores execution from the checkpoint's position. The Persistence feature does not need to be installed on the agent for this to work.

Return

The output produced by the agent after resuming from the checkpoint.

Parameters

agent

The agent to run.

input

The input to provide to the agent.

checkpoint

The checkpoint data to restore from.

rollbackStrategy

The strategy to use when restoring state. Defaults to RollbackStrategy.Default.

sessionId

Optional session identifier. A random UUID is generated if not provided.


suspend fun <Input, Output, TContext : AIAgentContext> runFromCheckpoint(session: AIAgentRunSession<Input, Output, TContext>, input: Input, checkpoint: AgentCheckpointData, rollbackStrategy: RollbackStrategy = RollbackStrategy.Default): Output(source)

Runs the session from a previously saved checkpoint.

Injects the checkpoint data into the session's storage so that the agent's graph strategy restores execution from the checkpoint's position. The Persistence feature does not need to be installed on the agent for this to work.

Return

The output produced by the session after resuming from the checkpoint.

Parameters

session

The session to run.

input

The input to provide to the session.

checkpoint

The checkpoint data to restore from.

rollbackStrategy

The strategy to use when restoring state. Defaults to RollbackStrategy.Default.