vapi_client/models/
rime_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 RimeAiVoice {
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::RimeAiVoiceVoiceId,
24    /// This is the model that will be used. Defaults to 'v1' 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 a flag that controls whether to add slight pauses using angle brackets. Example: \"Hi. <200> I'd love to have a conversation with you.\" adds a 200ms pause between the first and second sentences.
31    #[serde(
32        rename = "pauseBetweenBrackets",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub pause_between_brackets: Option<bool>,
36    /// This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: \"{h'El.o} World\" will pronounce \"Hello\" as expected.
37    #[serde(
38        rename = "phonemizeBetweenBrackets",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub phonemize_between_brackets: Option<bool>,
42    /// This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency
43    #[serde(rename = "reduceLatency", skip_serializing_if = "Option::is_none")]
44    pub reduce_latency: Option<bool>,
45    /// This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha
46    #[serde(rename = "inlineSpeedAlpha", skip_serializing_if = "Option::is_none")]
47    pub inline_speed_alpha: Option<String>,
48    /// This is the plan for chunking the model output before it is sent to the voice provider.
49    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
50    pub chunk_plan: Option<models::ChunkPlan>,
51    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
52    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
53    pub fallback_plan: Option<models::FallbackPlan>,
54}
55
56impl RimeAiVoice {
57    pub fn new(provider: ProviderTrue, voice_id: models::RimeAiVoiceVoiceId) -> RimeAiVoice {
58        RimeAiVoice {
59            caching_enabled: None,
60            provider,
61            voice_id,
62            model: None,
63            speed: None,
64            pause_between_brackets: None,
65            phonemize_between_brackets: None,
66            reduce_latency: None,
67            inline_speed_alpha: None,
68            chunk_plan: None,
69            fallback_plan: None,
70        }
71    }
72}
73/// This is the voice provider that will be used.
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum ProviderTrue {
76    #[serde(rename = "rime-ai")]
77    RimeAi,
78}
79
80impl Default for ProviderTrue {
81    fn default() -> ProviderTrue {
82        Self::RimeAi
83    }
84}
85/// This is the model that will be used. Defaults to 'v1' when not specified.
86#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
87pub enum ModelTrue {
88    #[serde(rename = "v1")]
89    V1,
90    #[serde(rename = "mist")]
91    Mist,
92    #[serde(rename = "mistv2")]
93    Mistv2,
94}
95
96impl Default for ModelTrue {
97    fn default() -> ModelTrue {
98        Self::V1
99    }
100}