pub struct ModelStreamAccumulator { /* private fields */ }Expand description
Strictly reconstructs a canonical response from model stream events.
Implementations§
Source§impl ModelStreamAccumulator
impl ModelStreamAccumulator
Sourcepub fn push(
&mut self,
event: ModelStreamEvent,
) -> Result<Option<ModelResponse>, ModelError>
pub fn push( &mut self, event: ModelStreamEvent, ) -> Result<Option<ModelResponse>, ModelError>
Applies one event and returns the response when the terminal event arrives.
§Errors
Returns ModelError when event order is invalid, a delta targets the
wrong block type, indices collide, a response completes with open
blocks, or tool arguments contain malformed JSON.
Trait Implementations§
Source§impl Debug for ModelStreamAccumulator
impl Debug for ModelStreamAccumulator
Source§impl Default for ModelStreamAccumulator
impl Default for ModelStreamAccumulator
Source§fn default() -> ModelStreamAccumulator
fn default() -> ModelStreamAccumulator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelStreamAccumulator
impl RefUnwindSafe for ModelStreamAccumulator
impl Send for ModelStreamAccumulator
impl Sync for ModelStreamAccumulator
impl Unpin for ModelStreamAccumulator
impl UnsafeUnpin for ModelStreamAccumulator
impl UnwindSafe for ModelStreamAccumulator
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