vapi_client/models/livekit_smart_endpointing_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 LivekitSmartEndpointingPlan {
16 /// This is the provider for the smart endpointing plan.
17 #[serde(rename = "provider")]
18 pub provider: ProviderTrue,
19 /// This expression describes how long the bot will wait to start speaking based on the likelihood that the user has reached an endpoint. This is a millisecond valued function. It maps probabilities (real numbers on [0,1]) to milliseconds that the bot should wait before speaking ([0, \\infty]). Any negative values that are returned are set to zero (the bot can't start talking in the past). A probability of zero represents very high confidence that the caller has stopped speaking, and would like the bot to speak to them. A probability of one represents very high confidence that the caller is still speaking. Under the hood, this is parsed into a mathjs expression. Whatever you use to write your expression needs to be valid with respect to mathjs @default \"20 + 500 * sqrt(x) + 2500 * x^3\"
20 #[serde(rename = "waitFunction", skip_serializing_if = "Option::is_none")]
21 pub wait_function: Option<String>,
22}
23
24impl LivekitSmartEndpointingPlan {
25 pub fn new(provider: ProviderTrue) -> LivekitSmartEndpointingPlan {
26 LivekitSmartEndpointingPlan {
27 provider,
28 wait_function: None,
29 }
30 }
31}
32/// This is the provider for the smart endpointing plan.
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum ProviderTrue {
35 #[serde(rename = "vapi")]
36 Vapi,
37 #[serde(rename = "livekit")]
38 Livekit,
39}
40
41impl Default for ProviderTrue {
42 fn default() -> ProviderTrue {
43 Self::Vapi
44 }
45}