vapi_client/models/
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 CartesiaVoice {
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    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
41    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
42    pub fallback_plan: Option<models::FallbackPlan>,
43}
44
45impl CartesiaVoice {
46    pub fn new(provider: ProviderTrue, voice_id: String) -> CartesiaVoice {
47        CartesiaVoice {
48            caching_enabled: None,
49            provider,
50            voice_id,
51            model: None,
52            language: None,
53            experimental_controls: None,
54            chunk_plan: None,
55            fallback_plan: None,
56        }
57    }
58}
59/// This is the voice provider that will be used.
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum ProviderTrue {
62    #[serde(rename = "cartesia")]
63    Cartesia,
64}
65
66impl Default for ProviderTrue {
67    fn default() -> ProviderTrue {
68        Self::Cartesia
69    }
70}
71/// This is the model that will be used. This is optional and will default to the correct model for the voiceId.
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
73pub enum ModelTrue {
74    #[serde(rename = "sonic-2")]
75    Sonic2,
76    #[serde(rename = "sonic-english")]
77    SonicEnglish,
78    #[serde(rename = "sonic-multilingual")]
79    SonicMultilingual,
80    #[serde(rename = "sonic-preview")]
81    SonicPreview,
82    #[serde(rename = "sonic")]
83    Sonic,
84}
85
86impl Default for ModelTrue {
87    fn default() -> ModelTrue {
88        Self::Sonic2
89    }
90}
91/// This is the language that will be used. This is optional and will default to the correct language for the voiceId.
92#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
93pub enum LanguageTrue {
94    #[serde(rename = "en")]
95    En,
96    #[serde(rename = "de")]
97    De,
98    #[serde(rename = "es")]
99    Es,
100    #[serde(rename = "fr")]
101    Fr,
102    #[serde(rename = "ja")]
103    Ja,
104    #[serde(rename = "pt")]
105    Pt,
106    #[serde(rename = "zh")]
107    Zh,
108    #[serde(rename = "hi")]
109    Hi,
110    #[serde(rename = "it")]
111    It,
112    #[serde(rename = "ko")]
113    Ko,
114    #[serde(rename = "nl")]
115    Nl,
116    #[serde(rename = "pl")]
117    Pl,
118    #[serde(rename = "ru")]
119    Ru,
120    #[serde(rename = "sv")]
121    Sv,
122    #[serde(rename = "tr")]
123    Tr,
124}
125
126impl Default for LanguageTrue {
127    fn default() -> LanguageTrue {
128        Self::En
129    }
130}