pub struct DsmlParser { /* private fields */ }Expand description
Incremental parser for one DSML tool-call stanza.
Feed streamed bytes with feed; it can be called after every
byte. Incomplete input leaves state unchanged until enough bytes arrive,
while malformed completed input switches to DsmlState::Error so the
model gets a retryable tool error.
Implementations§
Source§impl DsmlParser
impl DsmlParser
Sourcepub fn error(&self) -> &str
pub fn error(&self) -> &str
Error message; empty unless the state is DsmlState::Error.
Sourcepub fn pending_call(&self) -> Option<ToolCall>
pub fn pending_call(&self) -> Option<ToolCall>
Snapshot of the invoke currently being parsed (name plus the arguments whose close tags have arrived), for mid-stream preflight.
Sourcepub fn param_close_prefix(&self) -> bool
pub fn param_close_prefix(&self) -> bool
True while the raw tail is a partial parameter close tag.
Trait Implementations§
Source§impl Debug for DsmlParser
impl Debug for DsmlParser
Source§impl Default for DsmlParser
impl Default for DsmlParser
Source§fn default() -> DsmlParser
fn default() -> DsmlParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DsmlParser
impl RefUnwindSafe for DsmlParser
impl Send for DsmlParser
impl Sync for DsmlParser
impl Unpin for DsmlParser
impl UnsafeUnpin for DsmlParser
impl UnwindSafe for DsmlParser
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