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(rename = "numberToDigitsCutoff", skip_serializing_if = "Option::is_none")]
21    pub number_to_digits_cutoff: Option<f64>,
22    /// 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 []
23    #[serde(rename = "replacements", skip_serializing_if = "Option::is_none")]
24    pub replacements: Option<Vec<models::FormatPlanReplacementsInner>>,
25    /// 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
26    #[serde(rename = "formattersEnabled", skip_serializing_if = "Option::is_none")]
27    pub formatters_enabled: Option<Vec<FormattersEnabled>>,
28}
29
30impl FormatPlan {
31    pub fn new() -> FormatPlan {
32        FormatPlan {
33            enabled: None,
34            number_to_digits_cutoff: None,
35            replacements: None,
36            formatters_enabled: None,
37        }
38    }
39}
40/// 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
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum FormattersEnabled {
43    #[serde(rename = "markdown")]
44    Markdown,
45    #[serde(rename = "asterisk")]
46    Asterisk,
47    #[serde(rename = "quote")]
48    Quote,
49    #[serde(rename = "dash")]
50    Dash,
51    #[serde(rename = "newline")]
52    Newline,
53    #[serde(rename = "colon")]
54    Colon,
55    #[serde(rename = "acronym")]
56    Acronym,
57    #[serde(rename = "dollarAmount")]
58    DollarAmount,
59    #[serde(rename = "email")]
60    Email,
61    #[serde(rename = "date")]
62    Date,
63    #[serde(rename = "time")]
64    Time,
65    #[serde(rename = "distance")]
66    Distance,
67    #[serde(rename = "unit")]
68    Unit,
69    #[serde(rename = "percentage")]
70    Percentage,
71    #[serde(rename = "phoneNumber")]
72    PhoneNumber,
73    #[serde(rename = "number")]
74    Number,
75}
76
77impl Default for FormattersEnabled {
78    fn default() -> FormattersEnabled {
79        Self::Markdown
80    }
81}
82