mod.rs 1.18 KB
Newer Older
1
// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
3
// SPDX-License-Identifier: Apache-2.0

4
5
use serde_json::Value;

6
pub mod config;
7
pub mod dsml;
8
9
pub mod harmony;
pub mod json;
10
pub mod parsers;
11
pub mod pythonic;
12
pub mod response;
13
14
#[cfg(test)]
pub mod tests;
15
pub mod tools;
16
pub mod xml;
17

18
19
20
21
22
23
24
/// Represents a tool definition with function schema.
#[derive(Debug, Clone)]
pub struct ToolDefinition {
    pub name: String,
    pub parameters: Option<Value>,
}

25
// Re-export main types and functions for convenience
26
27
28
pub use config::{
    JsonParserConfig, KimiK2ParserConfig, ParserConfig, ToolCallConfig, XmlParserConfig,
};
29
pub use dsml::try_tool_call_parse_dsml;
30
pub use harmony::parse_tool_calls_harmony_complete;
31
pub use json::try_tool_call_parse_json;
32
33
34
35
pub use parsers::{
    detect_and_parse_tool_call, detect_tool_call_start, find_tool_call_end_position,
    try_tool_call_parse,
};
36
pub use pythonic::try_tool_call_parse_pythonic;
37
38
pub use response::{CalledFunction, ToolCallResponse, ToolCallType};
pub use tools::{try_tool_call_parse_aggregate, try_tool_call_parse_stream};
39
pub use xml::try_tool_call_parse_kimi_k2;
40
pub use xml::try_tool_call_parse_xml;