vapi_client/models/
client_message_tool_calls.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 ClientMessageToolCalls {
16    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
17    pub phone_number: Option<models::ClientMessageWorkflowNodeStartedPhoneNumber>,
18    /// This is the type of the message. \"tool-calls\" is sent to call a tool.
19    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
20    pub r#type: Option<TypeTrue>,
21    /// This is the list of tools calls that the model is requesting along with the original tool configuration.
22    #[serde(rename = "toolWithToolCallList")]
23    pub tool_with_tool_call_list: Vec<models::ClientMessageToolCallsToolWithToolCallListInner>,
24    /// This is the timestamp of the message.
25    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
26    pub timestamp: Option<f64>,
27    /// This is the call that the message is associated with.
28    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
29    pub call: Option<models::Call>,
30    /// This is the customer that the message is associated with.
31    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
32    pub customer: Option<models::CreateCustomerDto>,
33    /// This is the assistant that the message is associated with.
34    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
35    pub assistant: Option<models::CreateAssistantDto>,
36    /// This is the list of tool calls that the model is requesting.
37    #[serde(rename = "toolCallList")]
38    pub tool_call_list: Vec<models::ToolCall>,
39}
40
41impl ClientMessageToolCalls {
42    pub fn new(
43        tool_with_tool_call_list: Vec<models::ClientMessageToolCallsToolWithToolCallListInner>,
44        tool_call_list: Vec<models::ToolCall>,
45    ) -> ClientMessageToolCalls {
46        ClientMessageToolCalls {
47            phone_number: None,
48            r#type: None,
49            tool_with_tool_call_list,
50            timestamp: None,
51            call: None,
52            customer: None,
53            assistant: None,
54            tool_call_list,
55        }
56    }
57}
58/// This is the type of the message. \"tool-calls\" is sent to call a tool.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum TypeTrue {
61    #[serde(rename = "tool-calls")]
62    ToolCalls,
63}
64
65impl Default for TypeTrue {
66    fn default() -> TypeTrue {
67        Self::ToolCalls
68    }
69}