Skip to main content

run_turn

Function run_turn 

Source
pub async fn run_turn(
    runtime: &mut Runtime,
    messages: &mut Vec<SharedMessage>,
    budget: TurnBudget,
    totals: &mut SessionTotals,
    interrupted: &Arc<AtomicBool>,
    deadline: Option<Instant>,
    on_event: impl FnMut(&StreamEvent, &SessionTotals),
) -> TurnReport
Expand description

Run one turn of runtime over messages under budget, metered into totals; messages becomes the turn’s final history. A signal cancels the turn; so does deadline (the handoff turn’s backstop).