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 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}
52
53impl FallbackRimeAiVoice {
54    pub fn new(
55        provider: ProviderTrue,
56        voice_id: models::RimeAiVoiceVoiceId,
57    ) -> FallbackRimeAiVoice {
58        FallbackRimeAiVoice {
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        }
70    }
71}
72/// This is the voice provider that will be used.
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum ProviderTrue {
75    #[serde(rename = "rime-ai")]
76    RimeAi,
77}
78
79impl Default for ProviderTrue {
80    fn default() -> ProviderTrue {
81        Self::RimeAi
82    }
83}
84/// This is the model that will be used. Defaults to 'v1' when not specified.
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum ModelTrue {
87    #[serde(rename = "v1")]
88    V1,
89    #[serde(rename = "mist")]
90    Mist,
91    #[serde(rename = "mistv2")]
92    Mistv2,
93}
94
95impl Default for ModelTrue {
96    fn default() -> ModelTrue {
97        Self::V1
98    }
99}