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};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct SmallestAiVoice {
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: Provider,
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<Model>,
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    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
34    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
35    pub fallback_plan: Option<models::FallbackPlan>,
36}
37
38impl SmallestAiVoice {
39    pub fn new(provider: Provider, voice_id: models::SmallestAiVoiceVoiceId) -> SmallestAiVoice {
40        SmallestAiVoice {
41            provider,
42            voice_id,
43            model: None,
44            speed: None,
45            chunk_plan: None,
46            fallback_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, ToSchema)]
52pub enum Provider {
53    #[serde(rename = "smallest-ai")]
54    SmallestAi,
55}
56
57impl Default for Provider {
58    fn default() -> Provider {
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, ToSchema)]
64pub enum Model {
65    #[serde(rename = "lightning")]
66    Lightning,
67}
68
69impl Default for Model {
70    fn default() -> Model {
71        Self::Lightning
72    }
73}