vapi_client/models/
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 PlayHtVoice {
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    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
49    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
50    pub fallback_plan: Option<Box<models::FallbackPlan>>,
51}
52
53impl PlayHtVoice {
54    pub fn new(provider: Provider, voice_id: models::PlayHtVoiceVoiceId) -> PlayHtVoice {
55        PlayHtVoice {
56            provider,
57            voice_id: Box::new(voice_id),
58            speed: None,
59            temperature: None,
60            emotion: None,
61            voice_guidance: None,
62            style_guidance: None,
63            text_guidance: None,
64            model: None,
65            language: None,
66            chunk_plan: None,
67            fallback_plan: None,
68        }
69    }
70}
71/// This is the voice provider that will be used.
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
73pub enum Provider {
74    #[serde(rename = "playht")]
75    Playht,
76}
77
78impl Default for Provider {
79    fn default() -> Provider {
80        Self::Playht
81    }
82}
83/// An emotion to be applied to the speech.
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum Emotion {
86    #[serde(rename = "female_happy")]
87    FemaleHappy,
88    #[serde(rename = "female_sad")]
89    FemaleSad,
90    #[serde(rename = "female_angry")]
91    FemaleAngry,
92    #[serde(rename = "female_fearful")]
93    FemaleFearful,
94    #[serde(rename = "female_disgust")]
95    FemaleDisgust,
96    #[serde(rename = "female_surprised")]
97    FemaleSurprised,
98    #[serde(rename = "male_happy")]
99    MaleHappy,
100    #[serde(rename = "male_sad")]
101    MaleSad,
102    #[serde(rename = "male_angry")]
103    MaleAngry,
104    #[serde(rename = "male_fearful")]
105    MaleFearful,
106    #[serde(rename = "male_disgust")]
107    MaleDisgust,
108    #[serde(rename = "male_surprised")]
109    MaleSurprised,
110}
111
112impl Default for Emotion {
113    fn default() -> Emotion {
114        Self::FemaleHappy
115    }
116}
117/// Playht voice model/engine to use.
118#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
119pub enum Model {
120    #[serde(rename = "PlayHT2.0")]
121    PlayHt2Period0,
122    #[serde(rename = "PlayHT2.0-turbo")]
123    PlayHt2Period0Turbo,
124    #[serde(rename = "Play3.0-mini")]
125    Play3Period0Mini,
126    #[serde(rename = "PlayDialog")]
127    PlayDialog,
128}
129
130impl Default for Model {
131    fn default() -> Model {
132        Self::PlayHt2Period0
133    }
134}
135/// The language to use for the speech.
136#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
137pub enum Language {
138    #[serde(rename = "afrikaans")]
139    Afrikaans,
140    #[serde(rename = "albanian")]
141    Albanian,
142    #[serde(rename = "amharic")]
143    Amharic,
144    #[serde(rename = "arabic")]
145    Arabic,
146    #[serde(rename = "bengali")]
147    Bengali,
148    #[serde(rename = "bulgarian")]
149    Bulgarian,
150    #[serde(rename = "catalan")]
151    Catalan,
152    #[serde(rename = "croatian")]
153    Croatian,
154    #[serde(rename = "czech")]
155    Czech,
156    #[serde(rename = "danish")]
157    Danish,
158    #[serde(rename = "dutch")]
159    Dutch,
160    #[serde(rename = "english")]
161    English,
162    #[serde(rename = "french")]
163    French,
164    #[serde(rename = "galician")]
165    Galician,
166    #[serde(rename = "german")]
167    German,
168    #[serde(rename = "greek")]
169    Greek,
170    #[serde(rename = "hebrew")]
171    Hebrew,
172    #[serde(rename = "hindi")]
173    Hindi,
174    #[serde(rename = "hungarian")]
175    Hungarian,
176    #[serde(rename = "indonesian")]
177    Indonesian,
178    #[serde(rename = "italian")]
179    Italian,
180    #[serde(rename = "japanese")]
181    Japanese,
182    #[serde(rename = "korean")]
183    Korean,
184    #[serde(rename = "malay")]
185    Malay,
186    #[serde(rename = "mandarin")]
187    Mandarin,
188    #[serde(rename = "polish")]
189    Polish,
190    #[serde(rename = "portuguese")]
191    Portuguese,
192    #[serde(rename = "russian")]
193    Russian,
194    #[serde(rename = "serbian")]
195    Serbian,
196    #[serde(rename = "spanish")]
197    Spanish,
198    #[serde(rename = "swedish")]
199    Swedish,
200    #[serde(rename = "tagalog")]
201    Tagalog,
202    #[serde(rename = "thai")]
203    Thai,
204    #[serde(rename = "turkish")]
205    Turkish,
206    #[serde(rename = "ukrainian")]
207    Ukrainian,
208    #[serde(rename = "urdu")]
209    Urdu,
210    #[serde(rename = "xhosa")]
211    Xhosa,
212}
213
214impl Default for Language {
215    fn default() -> Language {
216        Self::Afrikaans
217    }
218}
219