vapi_client/models/
fallback_vapi_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 FallbackVapiVoice {
19    /// This is the voice provider that will be used.
20    #[serde(rename = "provider")]
21    pub provider: Provider,
22    /// The voices provided by Vapi
23    #[serde(rename = "voiceId")]
24    pub voice_id: VoiceId,
25    /// This is the plan for chunking the model output before it is sent to the voice provider.
26    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
27    pub chunk_plan: Option<models::ChunkPlan>,
28}
29
30impl FallbackVapiVoice {
31    pub fn new(provider: Provider, voice_id: VoiceId) -> FallbackVapiVoice {
32        FallbackVapiVoice {
33            provider,
34            voice_id,
35            chunk_plan: None,
36        }
37    }
38}
39/// This is the voice provider that will be used.
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
41pub enum Provider {
42    #[serde(rename = "vapi")]
43    Vapi,
44}
45
46impl Default for Provider {
47    fn default() -> Provider {
48        Self::Vapi
49    }
50}
51/// The voices provided by Vapi
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
53pub enum VoiceId {
54    #[serde(rename = "Jordan")]
55    Jordan,
56    #[serde(rename = "Adi")]
57    Adi,
58    #[serde(rename = "Julia")]
59    Julia,
60    #[serde(rename = "Maibri (Web)")]
61    MaibriLeftParenthesisWebRightParenthesis,
62    #[serde(rename = "Maibri (Phone)")]
63    MaibriLeftParenthesisPhoneRightParenthesis,
64    #[serde(rename = "Ashley")]
65    Ashley,
66}
67
68impl Default for VoiceId {
69    fn default() -> VoiceId {
70        Self::Jordan
71    }
72}