vapi_client/models/
fallback_open_ai_voice.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FallbackOpenAiVoice {
17    /// This is the voice provider that will be used.
18    #[serde(rename = "provider")]
19    pub provider: Provider,
20    /// This is the provider-specific ID that will be used. Please note that ash, ballad, coral, sage, and verse may only be used with realtime models.
21    #[serde(rename = "voiceId")]
22    pub voice_id: VoiceId,
23    /// This is the speed multiplier that will be used.
24    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
25    pub speed: Option<f64>,
26    /// This is the plan for chunking the model output before it is sent to the voice provider.
27    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
28    pub chunk_plan: Option<models::ChunkPlan>,
29}
30
31impl FallbackOpenAiVoice {
32    pub fn new(provider: Provider, voice_id: VoiceId) -> FallbackOpenAiVoice {
33        FallbackOpenAiVoice {
34            provider,
35            voice_id,
36            speed: None,
37            chunk_plan: None,
38        }
39    }
40}
41/// This is the voice provider that will be used.
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Provider {
44    #[serde(rename = "openai")]
45    Openai,
46}
47
48impl Default for Provider {
49    fn default() -> Provider {
50        Self::Openai
51    }
52}
53/// This is the provider-specific ID that will be used. Please note that ash, ballad, coral, sage, and verse may only be used with realtime models.
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum VoiceId {
56    #[serde(rename = "alloy")]
57    Alloy,
58    #[serde(rename = "echo")]
59    Echo,
60    #[serde(rename = "fable")]
61    Fable,
62    #[serde(rename = "onyx")]
63    Onyx,
64    #[serde(rename = "nova")]
65    Nova,
66    #[serde(rename = "shimmer")]
67    Shimmer,
68    #[serde(rename = "ash")]
69    Ash,
70    #[serde(rename = "ballad")]
71    Ballad,
72    #[serde(rename = "coral")]
73    Coral,
74    #[serde(rename = "sage")]
75    Sage,
76    #[serde(rename = "verse")]
77    Verse,
78}
79
80impl Default for VoiceId {
81    fn default() -> VoiceId {
82        Self::Alloy
83    }
84}