vapi_client/models/
open_ai_voicemail_detection_plan.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 OpenAiVoicemailDetectionPlan {
16    /// This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message  - If we detect a voicemail beep before this, we will speak the message at that point.  - Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.  @default 30 @min 0 @max 60
17    #[serde(
18        rename = "beepMaxAwaitSeconds",
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub beep_max_await_seconds: Option<f64>,
22    /// This is the provider to use for voicemail detection.
23    #[serde(rename = "provider")]
24    pub provider: ProviderTrue,
25    /// This is the backoff plan for the voicemail detection.
26    #[serde(rename = "backoffPlan", skip_serializing_if = "Option::is_none")]
27    pub backoff_plan: Option<models::VoicemailDetectionBackoffPlan>,
28}
29
30impl OpenAiVoicemailDetectionPlan {
31    pub fn new(provider: ProviderTrue) -> OpenAiVoicemailDetectionPlan {
32        OpenAiVoicemailDetectionPlan {
33            beep_max_await_seconds: None,
34            provider,
35            backoff_plan: None,
36        }
37    }
38}
39/// This is the provider to use for voicemail detection.
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum ProviderTrue {
42    #[serde(rename = "openai")]
43    Openai,
44}
45
46impl Default for ProviderTrue {
47    fn default() -> ProviderTrue {
48        Self::Openai
49    }
50}