vapi_client/models/
tool_call.rs

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