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