vapi_client/models/stop_speaking_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 StopSpeakingPlan {
16 /// This is the number of words that the customer has to say before the assistant will stop talking. Words like \"stop\", \"actually\", \"no\", etc. will always interrupt immediately regardless of this value. Words like \"okay\", \"yeah\", \"right\" will never interrupt. When set to 0, `voiceSeconds` is used in addition to the transcriptions to determine the customer has started speaking. Defaults to 0. @default 0
17 #[serde(rename = "numWords", skip_serializing_if = "Option::is_none")]
18 pub num_words: Option<f64>,
19 /// This is the seconds customer has to speak before the assistant stops talking. This uses the VAD (Voice Activity Detection) spike to determine if the customer has started speaking. Considerations: - A lower value might be more responsive but could potentially pick up non-speech sounds. - A higher value reduces false positives but might slightly delay the detection of speech onset. This is only used if `numWords` is set to 0. Defaults to 0.2 @default 0.2
20 #[serde(rename = "voiceSeconds", skip_serializing_if = "Option::is_none")]
21 pub voice_seconds: Option<f64>,
22 /// This is the seconds to wait before the assistant will start talking again after being interrupted. Defaults to 1. @default 1
23 #[serde(rename = "backoffSeconds", skip_serializing_if = "Option::is_none")]
24 pub backoff_seconds: Option<f64>,
25 /// These are the phrases that will never interrupt the assistant, even if numWords threshold is met. These are typically acknowledgement or backchanneling phrases.
26 #[serde(
27 rename = "acknowledgementPhrases",
28 skip_serializing_if = "Option::is_none"
29 )]
30 pub acknowledgement_phrases: Option<Vec<String>>,
31 /// These are the phrases that will always interrupt the assistant immediately, regardless of numWords. These are typically phrases indicating disagreement or desire to stop.
32 #[serde(
33 rename = "interruptionPhrases",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub interruption_phrases: Option<Vec<String>>,
37}
38
39impl StopSpeakingPlan {
40 pub fn new() -> StopSpeakingPlan {
41 StopSpeakingPlan {
42 num_words: None,
43 voice_seconds: None,
44 backoff_seconds: None,
45 acknowledgement_phrases: None,
46 interruption_phrases: None,
47 }
48 }
49}