vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ToolCallMessage {
    /// The role of the tool call in the conversation.
    #[serde(rename = "role")]
    pub role: String,
    /// The list of tool calls made during the conversation.
    #[serde(rename = "toolCalls")]
    pub tool_calls: Vec<serde_json::Value>,
    /// The message content for the tool call.
    #[serde(rename = "message")]
    pub message: String,
    /// The timestamp when the message was sent.
    #[serde(rename = "time")]
    pub time: f64,
    /// The number of seconds from the start of the conversation.
    #[serde(rename = "secondsFromStart")]
    pub seconds_from_start: f64,
}

impl ToolCallMessage {
    pub fn new(
        role: String,
        tool_calls: Vec<serde_json::Value>,
        message: String,
        time: f64,
        seconds_from_start: f64,
    ) -> ToolCallMessage {
        ToolCallMessage {
            role,
            tool_calls,
            message,
            time,
            seconds_from_start,
        }
    }
}