vapi_client/models/
fallback_play_ht_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 FallbackPlayHtVoice {
16    /// This is the voice provider that will be used.
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    #[serde(rename = "voiceId")]
20    pub voice_id: Box<models::PlayHtVoiceVoiceId>,
21    /// This is the speed multiplier that will be used.
22    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
23    pub speed: Option<f64>,
24    /// A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.
25    #[serde(rename = "temperature", skip_serializing_if = "Option::is_none")]
26    pub temperature: Option<f64>,
27    /// An emotion to be applied to the speech.
28    #[serde(rename = "emotion", skip_serializing_if = "Option::is_none")]
29    pub emotion: Option<Emotion>,
30    /// A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.
31    #[serde(rename = "voiceGuidance", skip_serializing_if = "Option::is_none")]
32    pub voice_guidance: Option<f64>,
33    /// A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.
34    #[serde(rename = "styleGuidance", skip_serializing_if = "Option::is_none")]
35    pub style_guidance: Option<f64>,
36    /// A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.
37    #[serde(rename = "textGuidance", skip_serializing_if = "Option::is_none")]
38    pub text_guidance: Option<f64>,
39    /// Playht voice model/engine to use.
40    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
41    pub model: Option<Model>,
42    /// The language to use for the speech.
43    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
44    pub language: Option<Language>,
45    /// This is the plan for chunking the model output before it is sent to the voice provider.
46    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
47    pub chunk_plan: Option<Box<models::ChunkPlan>>,
48}
49
50impl FallbackPlayHtVoice {
51    pub fn new(provider: Provider, voice_id: models::PlayHtVoiceVoiceId) -> FallbackPlayHtVoice {
52        FallbackPlayHtVoice {
53            provider,
54            voice_id: Box::new(voice_id),
55            speed: None,
56            temperature: None,
57            emotion: None,
58            voice_guidance: None,
59            style_guidance: None,
60            text_guidance: None,
61            model: None,
62            language: None,
63            chunk_plan: None,
64        }
65    }
66}
67/// This is the voice provider that will be used.
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum Provider {
70    #[serde(rename = "playht")]
71    Playht,
72}
73
74impl Default for Provider {
75    fn default() -> Provider {
76        Self::Playht
77    }
78}
79/// An emotion to be applied to the speech.
80#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
81pub enum Emotion {
82    #[serde(rename = "female_happy")]
83    FemaleHappy,
84    #[serde(rename = "female_sad")]
85    FemaleSad,
86    #[serde(rename = "female_angry")]
87    FemaleAngry,
88    #[serde(rename = "female_fearful")]
89    FemaleFearful,
90    #[serde(rename = "female_disgust")]
91    FemaleDisgust,
92    #[serde(rename = "female_surprised")]
93    FemaleSurprised,
94    #[serde(rename = "male_happy")]
95    MaleHappy,
96    #[serde(rename = "male_sad")]
97    MaleSad,
98    #[serde(rename = "male_angry")]
99    MaleAngry,
100    #[serde(rename = "male_fearful")]
101    MaleFearful,
102    #[serde(rename = "male_disgust")]
103    MaleDisgust,
104    #[serde(rename = "male_surprised")]
105    MaleSurprised,
106}
107
108impl Default for Emotion {
109    fn default() -> Emotion {
110        Self::FemaleHappy
111    }
112}
113/// Playht voice model/engine to use.
114#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
115pub enum Model {
116    #[serde(rename = "PlayHT2.0")]
117    PlayHt2Period0,
118    #[serde(rename = "PlayHT2.0-turbo")]
119    PlayHt2Period0Turbo,
120    #[serde(rename = "Play3.0-mini")]
121    Play3Period0Mini,
122    #[serde(rename = "PlayDialog")]
123    PlayDialog,
124}
125
126impl Default for Model {
127    fn default() -> Model {
128        Self::PlayHt2Period0
129    }
130}
131/// The language to use for the speech.
132#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
133pub enum Language {
134    #[serde(rename = "afrikaans")]
135    Afrikaans,
136    #[serde(rename = "albanian")]
137    Albanian,
138    #[serde(rename = "amharic")]
139    Amharic,
140    #[serde(rename = "arabic")]
141    Arabic,
142    #[serde(rename = "bengali")]
143    Bengali,
144    #[serde(rename = "bulgarian")]
145    Bulgarian,
146    #[serde(rename = "catalan")]
147    Catalan,
148    #[serde(rename = "croatian")]
149    Croatian,
150    #[serde(rename = "czech")]
151    Czech,
152    #[serde(rename = "danish")]
153    Danish,
154    #[serde(rename = "dutch")]
155    Dutch,
156    #[serde(rename = "english")]
157    English,
158    #[serde(rename = "french")]
159    French,
160    #[serde(rename = "galician")]
161    Galician,
162    #[serde(rename = "german")]
163    German,
164    #[serde(rename = "greek")]
165    Greek,
166    #[serde(rename = "hebrew")]
167    Hebrew,
168    #[serde(rename = "hindi")]
169    Hindi,
170    #[serde(rename = "hungarian")]
171    Hungarian,
172    #[serde(rename = "indonesian")]
173    Indonesian,
174    #[serde(rename = "italian")]
175    Italian,
176    #[serde(rename = "japanese")]
177    Japanese,
178    #[serde(rename = "korean")]
179    Korean,
180    #[serde(rename = "malay")]
181    Malay,
182    #[serde(rename = "mandarin")]
183    Mandarin,
184    #[serde(rename = "polish")]
185    Polish,
186    #[serde(rename = "portuguese")]
187    Portuguese,
188    #[serde(rename = "russian")]
189    Russian,
190    #[serde(rename = "serbian")]
191    Serbian,
192    #[serde(rename = "spanish")]
193    Spanish,
194    #[serde(rename = "swedish")]
195    Swedish,
196    #[serde(rename = "tagalog")]
197    Tagalog,
198    #[serde(rename = "thai")]
199    Thai,
200    #[serde(rename = "turkish")]
201    Turkish,
202    #[serde(rename = "ukrainian")]
203    Ukrainian,
204    #[serde(rename = "urdu")]
205    Urdu,
206    #[serde(rename = "xhosa")]
207    Xhosa,
208}
209
210impl Default for Language {
211    fn default() -> Language {
212        Self::Afrikaans
213    }
214}
215