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 FallbackCartesiaVoice {
    /// This is the flag to toggle voice caching for the assistant.
    #[serde(rename = "cachingEnabled", skip_serializing_if = "Option::is_none")]
    pub caching_enabled: Option<bool>,
    /// This is the voice provider that will be used.
    #[serde(rename = "provider")]
    pub provider: ProviderTrue,
    /// The ID of the particular voice you want to use.
    #[serde(rename = "voiceId")]
    pub voice_id: String,
    /// This is the model that will be used. This is optional and will default to the correct model for the voiceId.
    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
    pub model: Option<ModelTrue>,
    /// This is the language that will be used. This is optional and will default to the correct language for the voiceId.
    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
    pub language: Option<LanguageTrue>,
    /// Experimental controls for Cartesia voice generation
    #[serde(
        rename = "experimentalControls",
        skip_serializing_if = "Option::is_none"
    )]
    pub experimental_controls: Option<models::CartesiaExperimentalControls>,
    /// This is the plan for chunking the model output before it is sent to the voice provider.
    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
    pub chunk_plan: Option<models::ChunkPlan>,
}

impl FallbackCartesiaVoice {
    pub fn new(provider: ProviderTrue, voice_id: String) -> FallbackCartesiaVoice {
        FallbackCartesiaVoice {
            caching_enabled: None,
            provider,
            voice_id,
            model: None,
            language: None,
            experimental_controls: None,
            chunk_plan: None,
        }
    }
}
/// This is the voice provider that will be used.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
    #[serde(rename = "cartesia")]
    Cartesia,
}

impl Default for ProviderTrue {
    fn default() -> ProviderTrue {
        Self::Cartesia
    }
}
/// This is the model that will be used. This is optional and will default to the correct model for the voiceId.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ModelTrue {
    #[serde(rename = "sonic-2")]
    Sonic2,
    #[serde(rename = "sonic-english")]
    SonicEnglish,
    #[serde(rename = "sonic-multilingual")]
    SonicMultilingual,
    #[serde(rename = "sonic-preview")]
    SonicPreview,
    #[serde(rename = "sonic")]
    Sonic,
}

impl Default for ModelTrue {
    fn default() -> ModelTrue {
        Self::Sonic2
    }
}
/// This is the language that will be used. This is optional and will default to the correct language for the voiceId.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LanguageTrue {
    #[serde(rename = "en")]
    En,
    #[serde(rename = "de")]
    De,
    #[serde(rename = "es")]
    Es,
    #[serde(rename = "fr")]
    Fr,
    #[serde(rename = "ja")]
    Ja,
    #[serde(rename = "pt")]
    Pt,
    #[serde(rename = "zh")]
    Zh,
    #[serde(rename = "hi")]
    Hi,
    #[serde(rename = "it")]
    It,
    #[serde(rename = "ko")]
    Ko,
    #[serde(rename = "nl")]
    Nl,
    #[serde(rename = "pl")]
    Pl,
    #[serde(rename = "ru")]
    Ru,
    #[serde(rename = "sv")]
    Sv,
    #[serde(rename = "tr")]
    Tr,
}

impl Default for LanguageTrue {
    fn default() -> LanguageTrue {
        Self::En
    }
}