Skip to main content

TokenToolParser

Trait TokenToolParser 

Source
pub trait TokenToolParser: ToolParser {
    // Required methods
    fn parse_complete_tokens<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tokens: &'life1 [u32],
    ) -> Pin<Box<dyn Future<Output = ParserResult<(String, Vec<ToolCall>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn parse_incremental_tokens<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        tokens: &'life1 [u32],
        tools: &'life2 [Tool],
    ) -> Pin<Box<dyn Future<Output = ParserResult<StreamingParseResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Methods§

Source

fn parse_complete_tokens<'life0, 'life1, 'async_trait>( &'life0 self, tokens: &'life1 [u32], ) -> Pin<Box<dyn Future<Output = ParserResult<(String, Vec<ToolCall>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Parse complete tool calls when provided with raw token IDs.

Source

fn parse_incremental_tokens<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, tokens: &'life1 [u32], tools: &'life2 [Tool], ) -> Pin<Box<dyn Future<Output = ParserResult<StreamingParseResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Streaming parser entrypoint for token chunks. Parsers maintain internal state, so self is mutable

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§