pub struct ModelTurnFinished<'a> {
pub turn: usize,
pub content: &'a Vec<AssistantContent>,
pub usage: Usage,
pub identity: &'a ResponseIdentity,
pub finish_reason: Option<&'a FinishReason>,
pub max_tokens: Option<u64>,
pub raw: &'a Value,
}Expand description
Medium-neutral accepted model-turn event.
The turn is canonicalized and parked in the run state, but has not yet been
advanced into tool execution or finalization. A hook may therefore reject a
tool-free turn with ModelTurnAction::Retry.
Fields§
§turn: usizeOne-based model-call index.
content: &'a Vec<AssistantContent>Canonical assistant content parked for hook acceptance.
usage: UsageUsage reported for the turn.
identity: &'a ResponseIdentityThis exact attempt’s response identity metadata, the same value the
preceding completion outcome (OutcomeEvent) carried. On a retry, this is
the retried attempt’s own identity, never a previous attempt’s.
finish_reason: Option<&'a FinishReason>This attempt’s normalized terminal reason, or None when unreported.
Unknown reasons retain their spelling in FinishReason::Other.
A reported Stop is reconciled to ToolCalls when calls are present.
max_tokens: Option<u64>This attempt’s output-token cap after agent configuration, request
overrides, and completion-call patches. None leaves the cap to the provider.
raw: &'a ValueThis attempt’s decoded provider response, serialized as JSON on both
streaming and unary surfaces. Hand-constructed responses may use Null.