vapi_client/models/
smallest_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 SmallestAiVoice {
17    /// This is the voice provider that will be used.
18    #[serde(rename = "provider")]
19    pub provider: Provider,
20    #[serde(rename = "voiceId")]
21    pub voice_id: models::SmallestAiVoiceVoiceId,
22    /// Smallest AI voice model to use. Defaults to 'lightning' when not specified.
23    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
24    pub model: Option<Model>,
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    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
32    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
33    pub fallback_plan: Option<models::FallbackPlan>,
34}
35
36impl SmallestAiVoice {
37    pub fn new(provider: Provider, voice_id: models::SmallestAiVoiceVoiceId) -> SmallestAiVoice {
38        SmallestAiVoice {
39            provider,
40            voice_id,
41            model: None,
42            speed: None,
43            chunk_plan: None,
44            fallback_plan: None,
45        }
46    }
47}
48/// This is the voice provider that will be used.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Provider {
51    #[serde(rename = "smallest-ai")]
52    SmallestAi,
53}
54
55impl Default for Provider {
56    fn default() -> Provider {
57        Self::SmallestAi
58    }
59}
60/// Smallest AI voice model to use. Defaults to 'lightning' when not specified.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Model {
63    #[serde(rename = "lightning")]
64    Lightning,
65}
66
67impl Default for Model {
68    fn default() -> Model {
69        Self::Lightning
70    }
71}