vapi_client/models/
fallback_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 FallbackTavusVoice {
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 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(
35        rename = "conversationalContext",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub conversational_context: Option<String>,
39    /// This is the custom greeting that the replica will give once a participant joines the conversation.
40    #[serde(rename = "customGreeting", skip_serializing_if = "Option::is_none")]
41    pub custom_greeting: Option<String>,
42    /// These are optional properties used to customize the conversation.
43    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
44    pub properties: Option<models::TavusConversationProperties>,
45    /// This is the plan for chunking the model output before it is sent to the voice provider.
46    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
47    pub chunk_plan: Option<models::ChunkPlan>,
48}
49
50impl FallbackTavusVoice {
51    pub fn new(provider: ProviderTrue, voice_id: models::TavusVoiceVoiceId) -> FallbackTavusVoice {
52        FallbackTavusVoice {
53            caching_enabled: None,
54            provider,
55            voice_id,
56            persona_id: None,
57            callback_url: None,
58            conversation_name: None,
59            conversational_context: None,
60            custom_greeting: None,
61            properties: None,
62            chunk_plan: None,
63        }
64    }
65}
66/// This is the voice provider that will be used.
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum ProviderTrue {
69    #[serde(rename = "tavus")]
70    Tavus,
71}
72
73impl Default for ProviderTrue {
74    fn default() -> ProviderTrue {
75        Self::Tavus
76    }
77}