vapi_client/models/format_plan.rs
1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use utoipa::OpenApi;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
18pub struct FormatPlan {
19 /// 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
20 #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
21 pub enabled: Option<bool>,
22 /// 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
23 #[serde(
24 rename = "numberToDigitsCutoff",
25 skip_serializing_if = "Option::is_none"
26 )]
27 pub number_to_digits_cutoff: Option<f64>,
28 /// 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 []
29 #[serde(rename = "replacements", skip_serializing_if = "Option::is_none")]
30 pub replacements: Option<Vec<models::FormatPlanReplacementsInner>>,
31 /// 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
32 #[serde(rename = "formattersEnabled", skip_serializing_if = "Option::is_none")]
33 pub formatters_enabled: Option<Vec<FormattersEnabled>>,
34}
35
36impl FormatPlan {
37 pub fn new() -> FormatPlan {
38 FormatPlan {
39 enabled: None,
40 number_to_digits_cutoff: None,
41 replacements: None,
42 formatters_enabled: None,
43 }
44 }
45}
46/// 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
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
48pub enum FormattersEnabled {
49 #[serde(rename = "markdown")]
50 Markdown,
51 #[serde(rename = "asterisk")]
52 Asterisk,
53 #[serde(rename = "quote")]
54 Quote,
55 #[serde(rename = "dash")]
56 Dash,
57 #[serde(rename = "newline")]
58 Newline,
59 #[serde(rename = "colon")]
60 Colon,
61 #[serde(rename = "acronym")]
62 Acronym,
63 #[serde(rename = "dollarAmount")]
64 DollarAmount,
65 #[serde(rename = "email")]
66 Email,
67 #[serde(rename = "date")]
68 Date,
69 #[serde(rename = "time")]
70 Time,
71 #[serde(rename = "distance")]
72 Distance,
73 #[serde(rename = "unit")]
74 Unit,
75 #[serde(rename = "percentage")]
76 Percentage,
77 #[serde(rename = "phoneNumber")]
78 PhoneNumber,
79 #[serde(rename = "number")]
80 Number,
81}
82
83impl Default for FormattersEnabled {
84 fn default() -> FormattersEnabled {
85 Self::Markdown
86 }
87}