vapi_client/models/
deepgram_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 DeepgramVoice {
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::DeepgramVoiceVoiceId,
24    /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out  This will only be used if you are using your own Deepgram API key.  @default false
25    #[serde(rename = "mipOptOut", skip_serializing_if = "Option::is_none")]
26    pub mip_opt_out: Option<bool>,
27    /// This is the plan for chunking the model output before it is sent to the voice provider.
28    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
29    pub chunk_plan: Option<models::ChunkPlan>,
30    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
31    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
32    pub fallback_plan: Option<models::FallbackPlan>,
33}
34
35impl DeepgramVoice {
36    pub fn new(provider: Provider, voice_id: models::DeepgramVoiceVoiceId) -> DeepgramVoice {
37        DeepgramVoice {
38            provider,
39            voice_id,
40            mip_opt_out: None,
41            chunk_plan: None,
42            fallback_plan: None,
43        }
44    }
45}
46/// This is the voice provider that will be used.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
48pub enum Provider {
49    #[serde(rename = "deepgram")]
50    Deepgram,
51}
52
53impl Default for Provider {
54    fn default() -> Provider {
55        Self::Deepgram
56    }
57}