vapi_client/models/
tavus_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 TavusVoice {
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::TavusVoiceVoiceId,
21    /// This is the plan for chunking the model output before it is sent to the voice provider.
22    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
23    pub chunk_plan: Option<models::ChunkPlan>,
24    /// This is the unique identifier for the persona that the replica will use in the conversation.
25    #[serde(rename = "personaId", skip_serializing_if = "Option::is_none")]
26    pub persona_id: Option<String>,
27    /// This is the url that will receive webhooks with updates regarding the conversation state.
28    #[serde(rename = "callbackUrl", skip_serializing_if = "Option::is_none")]
29    pub callback_url: Option<String>,
30    /// This is the name for the conversation.
31    #[serde(rename = "conversationName", skip_serializing_if = "Option::is_none")]
32    pub conversation_name: Option<String>,
33    /// This is the context that will be appended to any context provided in the persona, if one is provided.
34    #[serde(rename = "conversationalContext", skip_serializing_if = "Option::is_none")]
35    pub conversational_context: Option<String>,
36    /// This is the custom greeting that the replica will give once a participant joines the conversation.
37    #[serde(rename = "customGreeting", skip_serializing_if = "Option::is_none")]
38    pub custom_greeting: Option<String>,
39    /// These are optional properties used to customize the conversation.
40    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
41    pub properties: Option<models::TavusConversationProperties>,
42    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
43    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
44    pub fallback_plan: Option<models::FallbackPlan>,
45}
46
47impl TavusVoice {
48    pub fn new(provider: Provider, voice_id: models::TavusVoiceVoiceId) -> TavusVoice {
49        TavusVoice {
50            provider,
51            voice_id,
52            chunk_plan: None,
53            persona_id: None,
54            callback_url: None,
55            conversation_name: None,
56            conversational_context: None,
57            custom_greeting: None,
58            properties: None,
59            fallback_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}
75