vapi_client/models/
vapi_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 VapiVoice {
16    /// This is the flag to toggle voice caching for the assistant.
17    #[serde(rename = "cachingEnabled", skip_serializing_if = "Option::is_none")]
18    pub caching_enabled: Option<bool>,
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: ProviderTrue,
22    /// The voices provided by Vapi
23    #[serde(rename = "voiceId")]
24    pub voice_id: VoiceIdTrue,
25    /// This is the speed multiplier that will be used.  @default 1
26    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
27    pub speed: Option<f64>,
28    /// This is the plan for chunking the model output before it is sent to the voice provider.
29    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
30    pub chunk_plan: Option<models::ChunkPlan>,
31    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
32    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
33    pub fallback_plan: Option<models::FallbackPlan>,
34}
35
36impl VapiVoice {
37    pub fn new(provider: ProviderTrue, voice_id: VoiceIdTrue) -> VapiVoice {
38        VapiVoice {
39            caching_enabled: None,
40            provider,
41            voice_id,
42            speed: None,
43            chunk_plan: None,
44            fallback_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 ProviderTrue {
51    #[serde(rename = "vapi")]
52    Vapi,
53}
54
55impl Default for ProviderTrue {
56    fn default() -> ProviderTrue {
57        Self::Vapi
58    }
59}
60/// The voices provided by Vapi
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum VoiceIdTrue {
63    #[serde(rename = "Elliot")]
64    Elliot,
65    #[serde(rename = "Kylie")]
66    Kylie,
67    #[serde(rename = "Rohan")]
68    Rohan,
69    #[serde(rename = "Lily")]
70    Lily,
71    #[serde(rename = "Savannah")]
72    Savannah,
73    #[serde(rename = "Hana")]
74    Hana,
75    #[serde(rename = "Neha")]
76    Neha,
77    #[serde(rename = "Cole")]
78    Cole,
79    #[serde(rename = "Harry")]
80    Harry,
81    #[serde(rename = "Paige")]
82    Paige,
83    #[serde(rename = "Spencer")]
84    Spencer,
85}
86
87impl Default for VoiceIdTrue {
88    fn default() -> VoiceIdTrue {
89        Self::Elliot
90    }
91}