vapi_client/models/
server_message_tool_calls.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 ServerMessageToolCalls {
17    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
18    pub phone_number: Option<models::ServerMessageAssistantRequestPhoneNumber>,
19    /// This is the type of the message. \"tool-calls\" is sent to call a tool.
20    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
21    pub r#type: Option<Type>,
22    /// This is the list of tools calls that the model is requesting along with the original tool configuration.
23    #[serde(rename = "toolWithToolCallList")]
24    pub tool_with_tool_call_list: Vec<models::ClientMessageToolCallsToolWithToolCallListInner>,
25    /// This is the ISO-8601 formatted timestamp of when the message was sent.
26    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
27    pub timestamp: Option<f64>,
28    /// This is a live version of the `call.artifact`.  This matches what is stored on `call.artifact` after the call.
29    #[serde(rename = "artifact", skip_serializing_if = "Option::is_none")]
30    pub artifact: Option<models::Artifact>,
31    /// This is the assistant that is currently active. This is provided for convenience.  This matches one of the following: - `call.assistant`, - `call.assistantId`, - `call.squad[n].assistant`, - `call.squad[n].assistantId`, - `call.squadId->[n].assistant`, - `call.squadId->[n].assistantId`.
32    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
33    pub assistant: Option<models::CreateAssistantDto>,
34    /// This is the customer associated with the call.  This matches one of the following: - `call.customer`, - `call.customerId`.
35    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
36    pub customer: Option<models::CreateCustomerDto>,
37    /// This is the call object.  This matches what was returned in POST /call.  Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id.
38    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
39    pub call: Option<models::Call>,
40    /// This is the list of tool calls that the model is requesting.
41    #[serde(rename = "toolCallList")]
42    pub tool_call_list: Vec<models::ToolCall>,
43}
44
45impl ServerMessageToolCalls {
46    pub fn new(
47        tool_with_tool_call_list: Vec<models::ClientMessageToolCallsToolWithToolCallListInner>,
48        tool_call_list: Vec<models::ToolCall>,
49    ) -> ServerMessageToolCalls {
50        ServerMessageToolCalls {
51            phone_number: None,
52            r#type: None,
53            tool_with_tool_call_list,
54            timestamp: None,
55            artifact: None,
56            assistant: None,
57            customer: None,
58            call: None,
59            tool_call_list,
60        }
61    }
62}
63/// This is the type of the message. \"tool-calls\" is sent to call a tool.
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum Type {
66    #[serde(rename = "tool-calls")]
67    ToolCalls,
68}
69
70impl Default for Type {
71    fn default() -> Type {
72        Self::ToolCalls
73    }
74}