vapi_client/models/
fallback_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 FallbackRimeAiVoice {
16    /// This is the voice provider that will be used.
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    #[serde(rename = "voiceId")]
20    pub voice_id: models::RimeAiVoiceVoiceId,
21    /// This is the model that will be used. Defaults to 'v1' when not specified.
22    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
23    pub model: Option<Model>,
24    /// This is the speed multiplier that will be used.
25    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
26    pub speed: Option<f64>,
27    /// 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.
28    #[serde(rename = "pauseBetweenBrackets", skip_serializing_if = "Option::is_none")]
29    pub pause_between_brackets: Option<bool>,
30    /// 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.
31    #[serde(rename = "phonemizeBetweenBrackets", skip_serializing_if = "Option::is_none")]
32    pub phonemize_between_brackets: Option<bool>,
33    /// 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
34    #[serde(rename = "reduceLatency", skip_serializing_if = "Option::is_none")]
35    pub reduce_latency: Option<bool>,
36    /// This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha
37    #[serde(rename = "inlineSpeedAlpha", skip_serializing_if = "Option::is_none")]
38    pub inline_speed_alpha: Option<String>,
39    /// This is the plan for chunking the model output before it is sent to the voice provider.
40    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
41    pub chunk_plan: Option<models::ChunkPlan>,
42}
43
44impl FallbackRimeAiVoice {
45    pub fn new(provider: Provider, voice_id: models::RimeAiVoiceVoiceId) -> FallbackRimeAiVoice {
46        FallbackRimeAiVoice {
47            provider,
48            voice_id,
49            model: None,
50            speed: None,
51            pause_between_brackets: None,
52            phonemize_between_brackets: None,
53            reduce_latency: None,
54            inline_speed_alpha: None,
55            chunk_plan: None,
56        }
57    }
58}
59/// This is the voice provider that will be used.
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum Provider {
62    #[serde(rename = "rime-ai")]
63    RimeAi,
64}
65
66impl Default for Provider {
67    fn default() -> Provider {
68        Self::RimeAi
69    }
70}
71/// This is the model that will be used. Defaults to 'v1' when not specified.
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
73pub enum Model {
74    #[serde(rename = "v1")]
75    V1,
76    #[serde(rename = "mist")]
77    Mist,
78    #[serde(rename = "mistv2")]
79    Mistv2,
80}
81
82impl Default for Model {
83    fn default() -> Model {
84        Self::V1
85    }
86}
87