[router] add tool parser base structure and partial json parser (#9482)

This commit is contained in:
Chang Su
2025-08-21 22:08:56 -07:00
committed by GitHub
parent 13ec8d427e
commit 816c4c8572
11 changed files with 1260 additions and 22 deletions

View File

@@ -0,0 +1,20 @@
/// Tool parser module for handling function/tool calls in model outputs
///
/// This module provides infrastructure for parsing tool calls from various model formats.
/// Phase 1 focuses on core infrastructure: types, traits, registry, and partial JSON parsing.
pub mod errors;
pub mod partial_json;
pub mod registry;
pub mod state;
pub mod traits;
pub mod types;
#[cfg(test)]
mod tests;
// Re-export commonly used types
pub use errors::{ToolParserError, ToolParserResult};
pub use registry::ParserRegistry;
pub use state::{ParsePhase, ParseState};
pub use traits::{PartialJsonParser, ToolParser};
pub use types::{FunctionCall, PartialToolCall, StreamResult, TokenConfig, ToolCall};