pub enum TurnEvent {
Started {
content: Vec<ContentBlock>,
},
RetryScheduled {
purpose: LlmCallPurpose,
attempt: u32,
max_attempts: u32,
delay_ms: u64,
},
LlmCallStarted {
purpose: LlmCallPurpose,
provider: Option<String>,
model: Option<String>,
display_name: String,
attempt: u32,
max_attempts: u32,
},
LlmCallEnded {
purpose: LlmCallPurpose,
outcome: LlmCallOutcome,
},
AutoContinue {
attempt: u32,
max_attempts: u32,
},
Ended {
outcome: TurnOutcome,
},
}Expand description
Turn lifecycle events.
A turn spans from a user message to a terminal TurnEvent::Ended. Within a
turn, each LLM call is bracketed by LlmCallStarted/LlmCallEnded; retries
surface as an LlmCallStarted with attempt > 0. Note that the completion
events for streamed message content
(MessageEvent with is_complete: true) are
emitted at turn completion, after the originating call’s LlmCallEnded.
Variants§
Started
A user message began a turn. Messages queued while a turn is active are folded into that turn and do not start a new one.
Fields
content: Vec<ContentBlock>RetryScheduled
A retry is waiting for its backoff delay before the request starts.
LlmCallStarted
An LLM request was issued.
Fields
purpose: LlmCallPurposeLlmCallEnded
An LLM call reached a terminal state.
AutoContinue
The agent is auto-continuing because the LLM stopped with a resumable stop reason.
Ended
The turn reached a terminal state.
Fields
outcome: TurnOutcomeImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TurnEvent
impl<'de> Deserialize<'de> for TurnEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TurnEvent
impl JsonSchema for TurnEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more