pub enum ModelEvent {
Show 14 variants
Served {
provider: String,
model: String,
},
TextDelta {
text: String,
},
ThinkingDelta {
text: String,
},
ThinkingSignature {
signature: String,
},
RedactedThinking {
data: String,
},
ToolUseStart {
id: String,
name: String,
},
ToolUse {
id: String,
name: String,
input: Value,
},
MalformedToolUse {
id: String,
name: String,
raw_input: String,
},
ToolArgsDelta {
id: String,
partial_json: String,
},
ContentBlockStart {
index: usize,
block: ModelContentBlock,
},
ContentBlockStop {
index: usize,
},
SearchResults {
hits: Vec<SearchHit>,
},
Truncated,
EndTurn {
stop_reason: String,
usage: Usage,
},
}Variants§
Served
The provider this call went to, first in the stream of a call that was routed; the call’s reasoning is stamped with it.
TextDelta
ThinkingDelta
Incremental extended-thinking text. Emitted so hosts can render the
model’s reasoning as it streams; the accumulated text plus the
signature from ModelEvent::ThinkingSignature become a
ModelContentBlock::Thinking in the transcript.
ThinkingSignature
The signature that closes the current thinking block. The API sends it once, at the end of the block.
RedactedThinking
A thinking block the API encrypted; opaque, forwarded whole.
ToolUseStart
The model has started a tool call; its arguments are still streaming.
The call itself is the ModelEvent::ToolUse that follows.
ToolUse
MalformedToolUse
A tool call whose arguments are not a JSON value — usually cut off because the reply reached its output limit. It is not run; it is answered with an error so the model can call again.
ToolArgsDelta
One raw fragment of a tool call’s arguments, exactly as the model
produced it. Observational only: the adapter still concatenates the
fragments and emits the assembled ModelEvent::ToolUse, which is what
the engine acts on. Forwarded alongside it because a malformed or
truncated argument stream is precisely the case worth investigating
afterwards, and concatenation destroys the evidence.
ContentBlockStart
ContentBlockStop
SearchResults
What a search the provider ran itself found (see
StreamParams::provider_search), in the order it reported them.
Truncated
The stream stopped without the provider saying the reply was done —
no end marker, no finish reason. What arrived is taken as the whole
reply; the ModelEvent::EndTurn that follows is the adapter’s, not
the provider’s.