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 ToolMessageDelayed {
    /// This is an alternative to the `content` property. It allows to specify variants of the same content, one per language.  Usage: - If your assistants are multilingual, you can provide content for each language. - If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.  This will override the `content` property.
    #[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
    pub contents: Option<Vec<models::ToolMessageStartContentsInner>>,
    /// This message is triggered when the tool call is delayed.  There are the two things that can trigger this message: 1. The user talks with the assistant while your server is processing the request. Default is \"Sorry, a few more seconds.\" 2. The server doesn't respond within `timingMilliseconds`.  This message is never triggered for async tool calls.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// The number of milliseconds to wait for the server response before saying this message.
    #[serde(rename = "timingMilliseconds", skip_serializing_if = "Option::is_none")]
    pub timing_milliseconds: Option<f64>,
    /// This is the content that the assistant says when this message is triggered.
    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
    /// This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.
    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<models::Condition>>,
}

impl ToolMessageDelayed {
    pub fn new(r#type: TypeTrue) -> ToolMessageDelayed {
        ToolMessageDelayed {
            contents: None,
            r#type,
            timing_milliseconds: None,
            content: None,
            conditions: None,
        }
    }
}
/// This message is triggered when the tool call is delayed.  There are the two things that can trigger this message: 1. The user talks with the assistant while your server is processing the request. Default is \"Sorry, a few more seconds.\" 2. The server doesn't respond within `timingMilliseconds`.  This message is never triggered for async tool calls.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "request-response-delayed")]
    RequestResponseDelayed,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::RequestResponseDelayed
    }
}