vapi_client/models/
format_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 FormatPlan {
16    /// This determines whether the chunk is formatted before being sent to the voice provider. This helps with enunciation. This includes phone numbers, emails and addresses. Default `true`.  Usage: - To rely on the voice provider's formatting logic, set this to `false`.  If `voice.chunkPlan.enabled` is `false`, this is automatically `false` since there's no chunk to format.  @default true
17    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
18    pub enabled: Option<bool>,
19    /// This is the cutoff after which a number is converted to individual digits instead of being spoken as words.  Example: - If cutoff 2025, \"12345\" is converted to \"1 2 3 4 5\" while \"1200\" is converted to \"twelve hundred\".  Usage: - If your use case doesn't involve IDs like zip codes, set this to a high value. - If your use case involves IDs that are shorter than 5 digits, set this to a lower value.  @default 2025
20    #[serde(
21        rename = "numberToDigitsCutoff",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub number_to_digits_cutoff: Option<f64>,
25    /// These are the custom replacements you can make to the chunk before it is sent to the voice provider.  Usage: - To replace a specific word or phrase with a different word or phrase, use the `ExactReplacement` type. Eg. `{ type: 'exact', key: 'hello', value: 'hi' }` - To replace a word or phrase that matches a pattern, use the `RegexReplacement` type. Eg. `{ type: 'regex', regex: '\\\\b[a-zA-Z]{5}\\\\b', value: 'hi' }`  @default []
26    #[serde(rename = "replacements", skip_serializing_if = "Option::is_none")]
27    pub replacements: Option<Vec<models::FormatPlanReplacementsInner>>,
28    /// List of formatters to apply. If not provided, all default formatters will be applied. If provided, only the specified formatters will be applied. Note: Some essential formatters like angle bracket removal will always be applied. @default undefined
29    #[serde(rename = "formattersEnabled", skip_serializing_if = "Option::is_none")]
30    pub formatters_enabled: Option<Vec<FormattersEnabledTrue>>,
31}
32
33impl FormatPlan {
34    pub fn new() -> FormatPlan {
35        FormatPlan {
36            enabled: None,
37            number_to_digits_cutoff: None,
38            replacements: None,
39            formatters_enabled: None,
40        }
41    }
42}
43/// List of formatters to apply. If not provided, all default formatters will be applied. If provided, only the specified formatters will be applied. Note: Some essential formatters like angle bracket removal will always be applied. @default undefined
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum FormattersEnabledTrue {
46    #[serde(rename = "markdown")]
47    Markdown,
48    #[serde(rename = "asterisk")]
49    Asterisk,
50    #[serde(rename = "quote")]
51    Quote,
52    #[serde(rename = "dash")]
53    Dash,
54    #[serde(rename = "newline")]
55    Newline,
56    #[serde(rename = "colon")]
57    Colon,
58    #[serde(rename = "acronym")]
59    Acronym,
60    #[serde(rename = "dollarAmount")]
61    DollarAmount,
62    #[serde(rename = "email")]
63    Email,
64    #[serde(rename = "date")]
65    Date,
66    #[serde(rename = "time")]
67    Time,
68    #[serde(rename = "distance")]
69    Distance,
70    #[serde(rename = "unit")]
71    Unit,
72    #[serde(rename = "percentage")]
73    Percentage,
74    #[serde(rename = "phoneNumber")]
75    PhoneNumber,
76    #[serde(rename = "number")]
77    Number,
78    #[serde(rename = "stripAsterisk")]
79    StripAsterisk,
80}
81
82impl Default for FormattersEnabledTrue {
83    fn default() -> FormattersEnabledTrue {
84        Self::Markdown
85    }
86}