mod.rs 1.11 KB
Newer Older
1
2
3
// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// 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
pub use config::{JsonParserConfig, ParserConfig, ToolCallConfig, XmlParserConfig};
27
pub use dsml::try_tool_call_parse_dsml;
28
pub use harmony::parse_tool_calls_harmony_complete;
29
pub use json::try_tool_call_parse_json;
30
31
32
33
pub use parsers::{
    detect_and_parse_tool_call, detect_tool_call_start, find_tool_call_end_position,
    try_tool_call_parse,
};
34
pub use pythonic::try_tool_call_parse_pythonic;
35
36
pub use response::{CalledFunction, ToolCallResponse, ToolCallType};
pub use tools::{try_tool_call_parse_aggregate, try_tool_call_parse_stream};
37
pub use xml::try_tool_call_parse_xml;