vapi_client/models/
message_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 MessagePlan {
16    /// This are the messages that the assistant will speak when the user hasn't responded for `idleTimeoutSeconds`. Each time the timeout is triggered, a random message will be chosen from this array.  Usage: - If user gets distracted and doesn't respond for a while, this can be used to grab their attention. - If the transcriber doesn't pick up what the user said, this can be used to ask the user to repeat themselves. (From the perspective of the assistant, the conversation is idle since it didn't \"hear\" any user messages.)  @default null (no idle message is spoken)
17    #[serde(rename = "idleMessages", skip_serializing_if = "Option::is_none")]
18    pub idle_messages: Option<Vec<String>>,
19    /// This determines the maximum number of times `idleMessages` can be spoken during the call.  @default 3
20    #[serde(
21        rename = "idleMessageMaxSpokenCount",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub idle_message_max_spoken_count: Option<f64>,
25    /// This determines whether the idle message count is reset whenever the user speaks.  @default false
26    #[serde(
27        rename = "idleMessageResetCountOnUserSpeechEnabled",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub idle_message_reset_count_on_user_speech_enabled: Option<bool>,
31    /// This is the timeout in seconds before a message from `idleMessages` is spoken. The clock starts when the assistant finishes speaking and remains active until the user speaks.  @default 10
32    #[serde(rename = "idleTimeoutSeconds", skip_serializing_if = "Option::is_none")]
33    pub idle_timeout_seconds: Option<f64>,
34    /// This is the message that the assistant will say if the call ends due to silence.  If unspecified, it will hang up without saying anything.
35    #[serde(
36        rename = "silenceTimeoutMessage",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub silence_timeout_message: Option<String>,
40}
41
42impl MessagePlan {
43    pub fn new() -> MessagePlan {
44        MessagePlan {
45            idle_messages: None,
46            idle_message_max_spoken_count: None,
47            idle_message_reset_count_on_user_speech_enabled: None,
48            idle_timeout_seconds: None,
49            silence_timeout_message: None,
50        }
51    }
52}