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};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct ToolCall {
19    /// This is the type of tool the model called.
20    #[serde(rename = "type")]
21    pub r#type: Type,
22    /// This is the function the model called.
23    #[serde(rename = "function")]
24    pub function: models::ToolCallFunction,
25    /// This is the unique identifier for the tool call.
26    #[serde(rename = "id")]
27    pub id: String,
28}
29
30impl ToolCall {
31    pub fn new(r#type: Type, function: models::ToolCallFunction, id: String) -> ToolCall {
32        ToolCall {
33            r#type,
34            function,
35            id,
36        }
37    }
38}
39/// This is the type of tool the model called.
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
41pub enum Type {
42    #[serde(rename = "function")]
43    Function,
44}
45
46impl Default for Type {
47    fn default() -> Type {
48        Self::Function
49    }
50}