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