vapi_client/models/
fallback_cartesia_voice.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FallbackCartesiaVoice {
16    /// This is the flag to toggle voice caching for the assistant.
17    #[serde(rename = "cachingEnabled", skip_serializing_if = "Option::is_none")]
18    pub caching_enabled: Option<bool>,
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: ProviderTrue,
22    /// The ID of the particular voice you want to use.
23    #[serde(rename = "voiceId")]
24    pub voice_id: String,
25    /// This is the model that will be used. This is optional and will default to the correct model for the voiceId.
26    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
27    pub model: Option<ModelTrue>,
28    /// This is the language that will be used. This is optional and will default to the correct language for the voiceId.
29    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
30    pub language: Option<LanguageTrue>,
31    /// Experimental controls for Cartesia voice generation
32    #[serde(
33        rename = "experimentalControls",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub experimental_controls: Option<models::CartesiaExperimentalControls>,
37    /// This is the plan for chunking the model output before it is sent to the voice provider.
38    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
39    pub chunk_plan: Option<models::ChunkPlan>,
40}
41
42impl FallbackCartesiaVoice {
43    pub fn new(provider: ProviderTrue, voice_id: String) -> FallbackCartesiaVoice {
44        FallbackCartesiaVoice {
45            caching_enabled: None,
46            provider,
47            voice_id,
48            model: None,
49            language: None,
50            experimental_controls: None,
51            chunk_plan: None,
52        }
53    }
54}
55/// This is the voice provider that will be used.
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum ProviderTrue {
58    #[serde(rename = "cartesia")]
59    Cartesia,
60}
61
62impl Default for ProviderTrue {
63    fn default() -> ProviderTrue {
64        Self::Cartesia
65    }
66}
67/// This is the model that will be used. This is optional and will default to the correct model for the voiceId.
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum ModelTrue {
70    #[serde(rename = "sonic-2")]
71    Sonic2,
72    #[serde(rename = "sonic-english")]
73    SonicEnglish,
74    #[serde(rename = "sonic-multilingual")]
75    SonicMultilingual,
76    #[serde(rename = "sonic-preview")]
77    SonicPreview,
78    #[serde(rename = "sonic")]
79    Sonic,
80}
81
82impl Default for ModelTrue {
83    fn default() -> ModelTrue {
84        Self::Sonic2
85    }
86}
87/// This is the language that will be used. This is optional and will default to the correct language for the voiceId.
88#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
89pub enum LanguageTrue {
90    #[serde(rename = "en")]
91    En,
92    #[serde(rename = "de")]
93    De,
94    #[serde(rename = "es")]
95    Es,
96    #[serde(rename = "fr")]
97    Fr,
98    #[serde(rename = "ja")]
99    Ja,
100    #[serde(rename = "pt")]
101    Pt,
102    #[serde(rename = "zh")]
103    Zh,
104    #[serde(rename = "hi")]
105    Hi,
106    #[serde(rename = "it")]
107    It,
108    #[serde(rename = "ko")]
109    Ko,
110    #[serde(rename = "nl")]
111    Nl,
112    #[serde(rename = "pl")]
113    Pl,
114    #[serde(rename = "ru")]
115    Ru,
116    #[serde(rename = "sv")]
117    Sv,
118    #[serde(rename = "tr")]
119    Tr,
120}
121
122impl Default for LanguageTrue {
123    fn default() -> LanguageTrue {
124        Self::En
125    }
126}