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