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