vapi_client/models/
fallback_assembly_ai_transcriber.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 FallbackAssemblyAiTranscriber {
16    /// This is the transcription provider that will be used.
17    #[serde(rename = "provider")]
18    pub provider: ProviderTrue,
19    /// This is the language that will be set for the transcription.
20    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
21    pub language: Option<LanguageTrue>,
22    /// Transcripts below this confidence threshold will be discarded.  @default 0.4
23    #[serde(
24        rename = "confidenceThreshold",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub confidence_threshold: Option<f64>,
28    /// Uses Assembly AI's new Universal Streaming API. See: https://www.assemblyai.com/docs/speech-to-text/universal-streaming  @default false
29    #[serde(
30        rename = "enableUniversalStreamingApi",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub enable_universal_streaming_api: Option<bool>,
34    /// This enables formatting of transcripts. Only used when `enableUniversalStreamingApi` is true.  @default false
35    #[serde(rename = "formatTurns", skip_serializing_if = "Option::is_none")]
36    pub format_turns: Option<bool>,
37    /// The confidence threshold to use when determining if the end of a turn has been reached. Only used when `enableUniversalStreamingApi` is true.  @default 0.7
38    #[serde(
39        rename = "endOfTurnConfidenceThreshold",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub end_of_turn_confidence_threshold: Option<f64>,
43    /// The minimum amount of silence in milliseconds required to detect end of turn when confident. Only used when `enableUniversalStreamingApi` is true.  @default 160
44    #[serde(
45        rename = "minEndOfTurnSilenceWhenConfident",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub min_end_of_turn_silence_when_confident: Option<f64>,
49    /// The maximum wait time for word finalization. Only used when `enableUniversalStreamingApi` is true.  @default 160
50    #[serde(
51        rename = "wordFinalizationMaxWaitTime",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub word_finalization_max_wait_time: Option<f64>,
55    /// The maximum amount of silence in milliseconds allowed in a turn before end of turn is triggered. Only used when `enableUniversalStreamingApi` is true.  @default 400
56    #[serde(rename = "maxTurnSilence", skip_serializing_if = "Option::is_none")]
57    pub max_turn_silence: Option<f64>,
58    /// The WebSocket URL that the transcriber connects to.
59    #[serde(rename = "realtimeUrl", skip_serializing_if = "Option::is_none")]
60    pub realtime_url: Option<String>,
61    /// Add up to 2500 characters of custom vocabulary.
62    #[serde(rename = "wordBoost", skip_serializing_if = "Option::is_none")]
63    pub word_boost: Option<Vec<String>>,
64    /// The duration of the end utterance silence threshold in milliseconds.
65    #[serde(
66        rename = "endUtteranceSilenceThreshold",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub end_utterance_silence_threshold: Option<f64>,
70    /// Disable partial transcripts. Set to `true` to not receive partial transcripts. Defaults to `false`.
71    #[serde(
72        rename = "disablePartialTranscripts",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub disable_partial_transcripts: Option<bool>,
76}
77
78impl FallbackAssemblyAiTranscriber {
79    pub fn new(provider: ProviderTrue) -> FallbackAssemblyAiTranscriber {
80        FallbackAssemblyAiTranscriber {
81            provider,
82            language: None,
83            confidence_threshold: None,
84            enable_universal_streaming_api: None,
85            format_turns: None,
86            end_of_turn_confidence_threshold: None,
87            min_end_of_turn_silence_when_confident: None,
88            word_finalization_max_wait_time: None,
89            max_turn_silence: None,
90            realtime_url: None,
91            word_boost: None,
92            end_utterance_silence_threshold: None,
93            disable_partial_transcripts: None,
94        }
95    }
96}
97/// This is the transcription provider that will be used.
98#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
99pub enum ProviderTrue {
100    #[serde(rename = "assembly-ai")]
101    AssemblyAi,
102}
103
104impl Default for ProviderTrue {
105    fn default() -> ProviderTrue {
106        Self::AssemblyAi
107    }
108}
109/// This is the language that will be set for the transcription.
110#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
111pub enum LanguageTrue {
112    #[serde(rename = "en")]
113    En,
114}
115
116impl Default for LanguageTrue {
117    fn default() -> LanguageTrue {
118        Self::En
119    }
120}