pub struct AssistantTextStreamParser { /* private fields */ }Expand description
Parses assistant text streaming markup in one pass:
- strips
<oai-mem-citation>tags and extracts citation payloads - in plan mode, also strips
<proposed_plan>blocks and emits plan segments
Implementations§
Source§impl AssistantTextStreamParser
impl AssistantTextStreamParser
pub fn new(plan_mode: bool) -> Self
pub fn push_str(&mut self, chunk: &str) -> AssistantTextChunk
pub fn finish(&mut self) -> AssistantTextChunk
Trait Implementations§
Source§impl Debug for AssistantTextStreamParser
impl Debug for AssistantTextStreamParser
Source§impl Default for AssistantTextStreamParser
impl Default for AssistantTextStreamParser
Source§fn default() -> AssistantTextStreamParser
fn default() -> AssistantTextStreamParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AssistantTextStreamParser
impl RefUnwindSafe for AssistantTextStreamParser
impl Send for AssistantTextStreamParser
impl Sync for AssistantTextStreamParser
impl Unpin for AssistantTextStreamParser
impl UnsafeUnpin for AssistantTextStreamParser
impl UnwindSafe for AssistantTextStreamParser
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