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};
12use utoipa::OpenApi;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
18pub struct FallbackOpenAiVoice {
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: Provider,
22    /// 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.
23    #[serde(rename = "voiceId")]
24    pub voice_id: VoiceId,
25    /// This is the speed multiplier that will be used.
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 FallbackOpenAiVoice {
34    pub fn new(provider: Provider, voice_id: VoiceId) -> FallbackOpenAiVoice {
35        FallbackOpenAiVoice {
36            provider,
37            voice_id,
38            speed: None,
39            chunk_plan: None,
40        }
41    }
42}
43/// This is the voice provider that will be used.
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
45pub enum Provider {
46    #[serde(rename = "openai")]
47    Openai,
48}
49
50impl Default for Provider {
51    fn default() -> Provider {
52        Self::Openai
53    }
54}
55/// 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.
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
57pub enum VoiceId {
58    #[serde(rename = "alloy")]
59    Alloy,
60    #[serde(rename = "echo")]
61    Echo,
62    #[serde(rename = "fable")]
63    Fable,
64    #[serde(rename = "onyx")]
65    Onyx,
66    #[serde(rename = "nova")]
67    Nova,
68    #[serde(rename = "shimmer")]
69    Shimmer,
70    #[serde(rename = "ash")]
71    Ash,
72    #[serde(rename = "ballad")]
73    Ballad,
74    #[serde(rename = "coral")]
75    Coral,
76    #[serde(rename = "sage")]
77    Sage,
78    #[serde(rename = "verse")]
79    Verse,
80}
81
82impl Default for VoiceId {
83    fn default() -> VoiceId {
84        Self::Alloy
85    }
86}