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