vapi_client/models/
fallback_open_ai_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 FallbackOpenAiVoice {
16    /// This is the voice provider that will be used.
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    /// 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.
20    #[serde(rename = "voiceId")]
21    pub voice_id: VoiceId,
22    /// This is the speed multiplier that will be used.
23    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
24    pub speed: Option<f64>,
25    /// This is the plan for chunking the model output before it is sent to the voice provider.
26    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
27    pub chunk_plan: Option<Box<models::ChunkPlan>>,
28}
29
30impl FallbackOpenAiVoice {
31    pub fn new(provider: Provider, voice_id: VoiceId) -> FallbackOpenAiVoice {
32        FallbackOpenAiVoice {
33            provider,
34            voice_id,
35            speed: None,
36            chunk_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 = "openai")]
44    Openai,
45}
46
47impl Default for Provider {
48    fn default() -> Provider {
49        Self::Openai
50    }
51}
52/// 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.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum VoiceId {
55    #[serde(rename = "alloy")]
56    Alloy,
57    #[serde(rename = "echo")]
58    Echo,
59    #[serde(rename = "fable")]
60    Fable,
61    #[serde(rename = "onyx")]
62    Onyx,
63    #[serde(rename = "nova")]
64    Nova,
65    #[serde(rename = "shimmer")]
66    Shimmer,
67    #[serde(rename = "ash")]
68    Ash,
69    #[serde(rename = "ballad")]
70    Ballad,
71    #[serde(rename = "coral")]
72    Coral,
73    #[serde(rename = "sage")]
74    Sage,
75    #[serde(rename = "verse")]
76    Verse,
77}
78
79impl Default for VoiceId {
80    fn default() -> VoiceId {
81        Self::Alloy
82    }
83}
84