pub struct PartialResponse { /* private fields */ }Expand description
Fault-recovery primitives for resilient agent execution. Partial response accumulator.
Collects streamed text and thinking deltas so they can be recovered if the stream terminates unexpectedly.
Implementations§
Source§impl PartialResponse
impl PartialResponse
Sourcepub fn new() -> PartialResponse
pub fn new() -> PartialResponse
Create a new empty partial response.
Sourcepub fn push_thinking(&mut self, delta: &str)
pub fn push_thinking(&mut self, delta: &str)
Append a thinking delta to the accumulated reasoning.
Sourcepub fn take_text(&mut self) -> String
pub fn take_text(&mut self) -> String
Take ownership of the accumulated text, leaving an empty string behind.
Sourcepub fn has_thinking(&self) -> bool
pub fn has_thinking(&self) -> bool
Returns true if any thinking content has been received.
Trait Implementations§
Source§impl Debug for PartialResponse
impl Debug for PartialResponse
Source§impl Default for PartialResponse
impl Default for PartialResponse
Source§fn default() -> PartialResponse
fn default() -> PartialResponse
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PartialResponse
impl RefUnwindSafe for PartialResponse
impl Send for PartialResponse
impl Sync for PartialResponse
impl Unpin for PartialResponse
impl UnsafeUnpin for PartialResponse
impl UnwindSafe for PartialResponse
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