vapi_client/models/
fallback_cartesia_voice.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use utoipa::OpenApi;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
18pub struct FallbackCartesiaVoice {
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: Provider,
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<Model>,
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<Language>,
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: Provider, voice_id: String) -> FallbackCartesiaVoice {
44        FallbackCartesiaVoice {
45            provider,
46            voice_id,
47            model: None,
48            language: None,
49            experimental_controls: None,
50            chunk_plan: None,
51        }
52    }
53}
54/// This is the voice provider that will be used.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
56pub enum Provider {
57    #[serde(rename = "cartesia")]
58    Cartesia,
59}
60
61impl Default for Provider {
62    fn default() -> Provider {
63        Self::Cartesia
64    }
65}
66/// This is the model that will be used. This is optional and will default to the correct model for the voiceId.
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
68pub enum Model {
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::SonicEnglish
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, OpenApi)]
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}