dynamo_parsers/tool_calling/response.rs
1// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4// #[cfg_attr(feature = "pyo3_macros", pyo3::pyclass(eq, eq_int))]
5// #[cfg_attr(feature = "pyo3_macros", pyo3(get_all))]
6#[derive(Clone, Debug, serde::Serialize, PartialEq)]
7#[serde(rename_all = "snake_case")]
8pub enum ToolCallType {
9 Function,
10}
11
12// #[cfg_attr(feature = "pyo3_macros", pyo3::pyclass)]
13// #[cfg_attr(feature = "pyo3_macros", pyo3(get_all))]
14#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
15pub struct CalledFunction {
16 pub name: String,
17 pub arguments: String,
18}
19
20// #[cfg_attr(feature = "pyo3_macros", pyo3::pyclass)]
21// #[cfg_attr(feature = "pyo3_macros", pyo3(get_all))]
22#[derive(Clone, Debug, serde::Serialize)]
23pub struct ToolCallResponse {
24 pub id: String,
25 #[serde(rename = "type")]
26 pub tp: ToolCallType,
27 pub function: CalledFunction,
28}