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(role: String, tool_calls: Vec<serde_json::Value>, message: String, time: f64, seconds_from_start: f64) -> ToolCallMessage {
35        ToolCallMessage {
36            role,
37            tool_calls,
38            message,
39            time,
40            seconds_from_start,
41        }
42    }
43}
44