vapi_client/models/
fallback_smallest_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 FallbackSmallestAiVoice {
16    /// This is the flag to toggle voice caching for the assistant.
17    #[serde(rename = "cachingEnabled", skip_serializing_if = "Option::is_none")]
18    pub caching_enabled: Option<bool>,
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: ProviderTrue,
22    #[serde(rename = "voiceId")]
23    pub voice_id: models::SmallestAiVoiceVoiceId,
24    /// Smallest AI voice model to use. Defaults to 'lightning' when not specified.
25    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
26    pub model: Option<ModelTrue>,
27    /// This is the speed multiplier that will be used.
28    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
29    pub speed: Option<f64>,
30    /// This is the plan for chunking the model output before it is sent to the voice provider.
31    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
32    pub chunk_plan: Option<models::ChunkPlan>,
33}
34
35impl FallbackSmallestAiVoice {
36    pub fn new(
37        provider: ProviderTrue,
38        voice_id: models::SmallestAiVoiceVoiceId,
39    ) -> FallbackSmallestAiVoice {
40        FallbackSmallestAiVoice {
41            caching_enabled: None,
42            provider,
43            voice_id,
44            model: None,
45            speed: None,
46            chunk_plan: None,
47        }
48    }
49}
50/// This is the voice provider that will be used.
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum ProviderTrue {
53    #[serde(rename = "smallest-ai")]
54    SmallestAi,
55}
56
57impl Default for ProviderTrue {
58    fn default() -> ProviderTrue {
59        Self::SmallestAi
60    }
61}
62/// Smallest AI voice model to use. Defaults to 'lightning' when not specified.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum ModelTrue {
65    #[serde(rename = "lightning")]
66    Lightning,
67}
68
69impl Default for ModelTrue {
70    fn default() -> ModelTrue {
71        Self::Lightning
72    }
73}