vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TavusVoice {
    /// This is the flag to toggle voice caching for the assistant.
    #[serde(rename = "cachingEnabled", skip_serializing_if = "Option::is_none")]
    pub caching_enabled: Option<bool>,
    /// This is the voice provider that will be used.
    #[serde(rename = "provider")]
    pub provider: ProviderTrue,
    #[serde(rename = "voiceId")]
    pub voice_id: models::TavusVoiceVoiceId,
    /// This is the plan for chunking the model output before it is sent to the voice provider.
    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
    pub chunk_plan: Option<models::ChunkPlan>,
    /// This is the unique identifier for the persona that the replica will use in the conversation.
    #[serde(rename = "personaId", skip_serializing_if = "Option::is_none")]
    pub persona_id: Option<String>,
    /// This is the url that will receive webhooks with updates regarding the conversation state.
    #[serde(rename = "callbackUrl", skip_serializing_if = "Option::is_none")]
    pub callback_url: Option<String>,
    /// This is the name for the conversation.
    #[serde(rename = "conversationName", skip_serializing_if = "Option::is_none")]
    pub conversation_name: Option<String>,
    /// This is the context that will be appended to any context provided in the persona, if one is provided.
    #[serde(
        rename = "conversationalContext",
        skip_serializing_if = "Option::is_none"
    )]
    pub conversational_context: Option<String>,
    /// This is the custom greeting that the replica will give once a participant joines the conversation.
    #[serde(rename = "customGreeting", skip_serializing_if = "Option::is_none")]
    pub custom_greeting: Option<String>,
    /// These are optional properties used to customize the conversation.
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<models::TavusConversationProperties>,
    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
    pub fallback_plan: Option<models::FallbackPlan>,
}

impl TavusVoice {
    pub fn new(provider: ProviderTrue, voice_id: models::TavusVoiceVoiceId) -> TavusVoice {
        TavusVoice {
            caching_enabled: None,
            provider,
            voice_id,
            chunk_plan: None,
            persona_id: None,
            callback_url: None,
            conversation_name: None,
            conversational_context: None,
            custom_greeting: None,
            properties: None,
            fallback_plan: None,
        }
    }
}
/// This is the voice provider that will be used.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
    #[serde(rename = "tavus")]
    Tavus,
}

impl Default for ProviderTrue {
    fn default() -> ProviderTrue {
        Self::Tavus
    }
}