vapi_client/models/
tool_call.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ToolCall {
16    /// This is the type of tool the model called.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// This is the function the model called.
20    #[serde(rename = "function")]
21    pub function: Box<models::ToolCallFunction>,
22    /// This is the unique identifier for the tool call.
23    #[serde(rename = "id")]
24    pub id: String,
25}
26
27impl ToolCall {
28    pub fn new(r#type: Type, function: models::ToolCallFunction, id: String) -> ToolCall {
29        ToolCall {
30            r#type,
31            function: Box::new(function),
32            id,
33        }
34    }
35}
36/// This is the type of tool the model called.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Type {
39    #[serde(rename = "function")]
40    Function,
41}
42
43impl Default for Type {
44    fn default() -> Type {
45        Self::Function
46    }
47}
48