Expand description
Partial completion support for agent execution
When an agent hits a limit (turns, tokens, cost, duration), this module allows capturing and saving the partial progress for potential resumption.
§Usage
ⓘ
use nika::runtime::partial::{PartialResult, PartialCheckpoint};
// Create checkpoint when limit is reached
let checkpoint = PartialCheckpoint::new(
"task-1",
0.65, // 65% complete
"Generated 3 of 5 sections",
);
// Save progress
checkpoint.save_to_file("./checkpoints/task-1.json").await?;
// Load and resume later
let restored = PartialCheckpoint::load_from_file("./checkpoints/task-1.json").await?;Structs§
- Checkpoint
Message - Message in checkpoint history
- Partial
Checkpoint - Checkpoint for resuming partial execution
- Partial
Result - Result of a partially completed task
Enums§
- Stop
Reason - Reason for partial completion