pub enum ModelFrame {
Input(ModelInput),
GenerationStarted,
ToolCall(ToolCall),
GenerationFinished,
}Expand description
Native language-model protocol frames: one generation’s boundaries and the structured items it consumes or produces. On the data lane the exact interleaving is preserved:
Model(GenerationStarted)
Transcript(agent partial)
Model(ToolCall)
Transcript(agent final)
Model(GenerationFinished)Text may come before or after a tool call, and a tool-call-only generation
emits no transcript — so don’t assume text precedes tool calls. No generation
id in v1: a stage runs one at a time, bounded by
GenerationStarted /
GenerationFinished.
Variants§
Input(ModelInput)
Add non-user information to the LM conversation; see ModelInput.
GenerationStarted
Marks the beginning of one LM generation.
ToolCall(ToolCall)
A complete structured ToolCall emitted by the model.
GenerationFinished
Marks successful completion of the generation stream.
Implementations§
Source§impl ModelFrame
impl ModelFrame
Sourcepub fn survives_flush(&self) -> bool
pub fn survives_flush(&self) -> bool
Model frames that outlive an interrupt flush: Input
(external input) and ToolCall (a completed call).
The generation boundaries belong to the interrupted turn and are dropped.
Consulted by DataFrame::survives_flush.
Trait Implementations§
Source§impl Clone for ModelFrame
impl Clone for ModelFrame
Source§fn clone(&self) -> ModelFrame
fn clone(&self) -> ModelFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelFrame
impl Debug for ModelFrame
impl Eq for ModelFrame
Source§impl From<ModelFrame> for DataFrame
impl From<ModelFrame> for DataFrame
Source§fn from(frame: ModelFrame) -> Self
fn from(frame: ModelFrame) -> Self
Wrap a ModelFrame as a DataFrame::Model.