pub enum ModelEvent {
Started,
OutputProgress {
progress: Option<ModelOutputProgress>,
},
OutputTextDelta {
delta: String,
},
ReasoningTextDelta {
delta: String,
},
ToolCallRequested {
call: ModelToolCall,
},
Completed {
response: ModelResponse,
},
}Expand description
Normalized event emitted by model providers.
Variants§
Started
Provider accepted the request and began producing output.
OutputProgress
Receive-side accounting without retaining text. None clears a failed attempt’s sample.
Fields
§
progress: Option<ModelOutputProgress>OutputTextDelta
Incremental text output.
ReasoningTextDelta
Incremental provider reasoning text. A summary is used only when raw reasoning is absent.
ToolCallRequested
Model requested a tool call.
Fields
§
call: ModelToolCallRequested tool call.
Completed
Stream completed. No events may be emitted after this event.
Fields
§
response: ModelResponseAggregated model response.
Trait Implementations§
Source§impl Clone for ModelEvent
impl Clone for ModelEvent
Source§fn clone(&self) -> ModelEvent
fn clone(&self) -> ModelEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelEvent
impl Debug for ModelEvent
Source§impl<'de> Deserialize<'de> for ModelEvent
impl<'de> Deserialize<'de> for ModelEvent
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ModelEvent, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ModelEvent, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for ModelEvent
impl JsonSchema for ModelEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ModelEvent
impl PartialEq for ModelEvent
Source§impl Serialize for ModelEvent
impl Serialize for ModelEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ModelEvent
Auto Trait Implementations§
impl Forget for ModelEvent
impl Freeze for ModelEventwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<ModelOutput>: Freeze,
impl Move for ModelEvent
impl RefUnwindSafe for ModelEvent
impl Send for ModelEvent
impl Sync for ModelEvent
impl Unpin for ModelEvent
impl UnsafeUnpin for ModelEventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<ModelOutput>: UnsafeUnpin,
impl UnwindSafe for ModelEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more