vapi_client/models/
tool_call_message.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 ToolCallMessage {
16    /// The role of the tool call in the conversation.
17    #[serde(rename = "role")]
18    pub role: String,
19    /// The list of tool calls made during the conversation.
20    #[serde(rename = "toolCalls")]
21    pub tool_calls: Vec<serde_json::Value>,
22    /// The message content for the tool call.
23    #[serde(rename = "message")]
24    pub message: String,
25    /// The timestamp when the message was sent.
26    #[serde(rename = "time")]
27    pub time: f64,
28    /// The number of seconds from the start of the conversation.
29    #[serde(rename = "secondsFromStart")]
30    pub seconds_from_start: f64,
31}
32
33impl ToolCallMessage {
34    pub fn new(
35        role: String,
36        tool_calls: Vec<serde_json::Value>,
37        message: String,
38        time: f64,
39        seconds_from_start: f64,
40    ) -> ToolCallMessage {
41        ToolCallMessage {
42            role,
43            tool_calls,
44            message,
45            time,
46            seconds_from_start,
47        }
48    }
49}