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 voice provider that will be used.
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    /// The voices provided by Vapi
20    #[serde(rename = "voiceId")]
21    pub voice_id: VoiceId,
22    /// This is the plan for chunking the model output before it is sent to the voice provider.
23    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
24    pub chunk_plan: Option<Box<models::ChunkPlan>>,
25    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
26    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
27    pub fallback_plan: Option<Box<models::FallbackPlan>>,
28}
29
30impl VapiVoice {
31    pub fn new(provider: Provider, voice_id: VoiceId) -> VapiVoice {
32        VapiVoice {
33            provider,
34            voice_id,
35            chunk_plan: None,
36            fallback_plan: None,
37        }
38    }
39}
40/// This is the voice provider that will be used.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Provider {
43    #[serde(rename = "vapi")]
44    Vapi,
45}
46
47impl Default for Provider {
48    fn default() -> Provider {
49        Self::Vapi
50    }
51}
52/// The voices provided by Vapi
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum VoiceId {
55    #[serde(rename = "Elliot")]
56    Elliot,
57    #[serde(rename = "Rohan")]
58    Rohan,
59    #[serde(rename = "Lily")]
60    Lily,
61    #[serde(rename = "Savannah")]
62    Savannah,
63    #[serde(rename = "Hana")]
64    Hana,
65    #[serde(rename = "Neha")]
66    Neha,
67    #[serde(rename = "Cole")]
68    Cole,
69    #[serde(rename = "Harry")]
70    Harry,
71    #[serde(rename = "Paige")]
72    Paige,
73}
74
75impl Default for VoiceId {
76    fn default() -> VoiceId {
77        Self::Elliot
78    }
79}
80