vapi_client/models/
fallback_tavus_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};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FallbackTavusVoice {
17    /// This is the voice provider that will be used.
18    #[serde(rename = "provider")]
19    pub provider: Provider,
20    #[serde(rename = "voiceId")]
21    pub voice_id: models::TavusVoiceVoiceId,
22    /// This is the unique identifier for the persona that the replica will use in the conversation.
23    #[serde(rename = "personaId", skip_serializing_if = "Option::is_none")]
24    pub persona_id: Option<String>,
25    /// This is the url that will receive webhooks with updates regarding the conversation state.
26    #[serde(rename = "callbackUrl", skip_serializing_if = "Option::is_none")]
27    pub callback_url: Option<String>,
28    /// This is the name for the conversation.
29    #[serde(rename = "conversationName", skip_serializing_if = "Option::is_none")]
30    pub conversation_name: Option<String>,
31    /// This is the context that will be appended to any context provided in the persona, if one is provided.
32    #[serde(
33        rename = "conversationalContext",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub conversational_context: Option<String>,
37    /// This is the custom greeting that the replica will give once a participant joines the conversation.
38    #[serde(rename = "customGreeting", skip_serializing_if = "Option::is_none")]
39    pub custom_greeting: Option<String>,
40    /// These are optional properties used to customize the conversation.
41    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
42    pub properties: Option<models::TavusConversationProperties>,
43    /// This is the plan for chunking the model output before it is sent to the voice provider.
44    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
45    pub chunk_plan: Option<models::ChunkPlan>,
46}
47
48impl FallbackTavusVoice {
49    pub fn new(provider: Provider, voice_id: models::TavusVoiceVoiceId) -> FallbackTavusVoice {
50        FallbackTavusVoice {
51            provider,
52            voice_id,
53            persona_id: None,
54            callback_url: None,
55            conversation_name: None,
56            conversational_context: None,
57            custom_greeting: None,
58            properties: None,
59            chunk_plan: None,
60        }
61    }
62}
63/// This is the voice provider that will be used.
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum Provider {
66    #[serde(rename = "tavus")]
67    Tavus,
68}
69
70impl Default for Provider {
71    fn default() -> Provider {
72        Self::Tavus
73    }
74}