#[non_exhaustive]pub enum StreamDelta {
TextDelta {
delta: String,
block_index: usize,
},
ThinkingDelta {
delta: String,
block_index: usize,
},
ToolUseStart {
id: String,
name: String,
block_index: usize,
thought_signature: Option<String>,
},
ToolInputDelta {
id: String,
delta: String,
block_index: usize,
},
Usage(Usage),
Done {
stop_reason: Option<StopReason>,
},
SignatureDelta {
delta: String,
block_index: usize,
},
RedactedThinking {
data: String,
block_index: usize,
},
OpaqueReasoning {
provider: String,
data: Value,
block_index: usize,
},
Error {
message: String,
kind: StreamErrorKind,
},
}Expand description
Events yielded during streaming LLM responses.
Each variant represents a different type of event that can occur during a streaming response from an LLM provider.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TextDelta
A text delta for streaming text content.
Fields
ThinkingDelta
A thinking delta for streaming thinking/reasoning content.
Fields
ToolUseStart
Start of a tool use block (name and id are known).
Fields
ToolInputDelta
Incremental JSON for tool input (partial/incomplete JSON).
Fields
Usage(Usage)
Usage information (typically at stream end).
Done
Stream completed with stop reason.
Fields
stop_reason: Option<StopReason>Why the stream ended
SignatureDelta
A signature delta for a thinking block.
Fields
RedactedThinking
A redacted thinking block received at content_block_start.
OpaqueReasoning
A complete provider-owned reasoning-state item.
Unlike text/thinking deltas this item is not user-visible and must not be interpreted. It is carried through the stream solely so agent history can replay it to the provider that owns it.
Fields
Error
Error during streaming.
Fields
kind: StreamErrorKindCategorization of the error so downstream consumers can map
it back to the correct agent_sdk_foundation::llm::ChatOutcome
variant or audit-record TurnAttemptOutcome without losing
the rate-limit / server-error / invalid-request distinction.
Trait Implementations§
Source§impl Clone for StreamDelta
impl Clone for StreamDelta
Source§fn clone(&self) -> StreamDelta
fn clone(&self) -> StreamDelta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more