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