vapi_client/models/
fallback_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 FallbackVapiVoice {
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}
32
33impl FallbackVapiVoice {
34    pub fn new(provider: ProviderTrue, voice_id: VoiceIdTrue) -> FallbackVapiVoice {
35        FallbackVapiVoice {
36            caching_enabled: None,
37            provider,
38            voice_id,
39            speed: None,
40            chunk_plan: None,
41        }
42    }
43}
44/// This is the voice provider that will be used.
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum ProviderTrue {
47    #[serde(rename = "vapi")]
48    Vapi,
49}
50
51impl Default for ProviderTrue {
52    fn default() -> ProviderTrue {
53        Self::Vapi
54    }
55}
56/// The voices provided by Vapi
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum VoiceIdTrue {
59    #[serde(rename = "Elliot")]
60    Elliot,
61    #[serde(rename = "Kylie")]
62    Kylie,
63    #[serde(rename = "Rohan")]
64    Rohan,
65    #[serde(rename = "Lily")]
66    Lily,
67    #[serde(rename = "Savannah")]
68    Savannah,
69    #[serde(rename = "Hana")]
70    Hana,
71    #[serde(rename = "Neha")]
72    Neha,
73    #[serde(rename = "Cole")]
74    Cole,
75    #[serde(rename = "Harry")]
76    Harry,
77    #[serde(rename = "Paige")]
78    Paige,
79    #[serde(rename = "Spencer")]
80    Spencer,
81}
82
83impl Default for VoiceIdTrue {
84    fn default() -> VoiceIdTrue {
85        Self::Elliot
86    }
87}