Skip to main content

Module partial

Module partial 

Source
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§

CheckpointMessage
Message in checkpoint history
PartialCheckpoint
Checkpoint for resuming partial execution
PartialResult
Result of a partially completed task

Enums§

StopReason
Reason for partial completion