vapi_client/models/
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 AssemblyAiTranscriber {
16    /// This is the transcription provider that will be used.
17    #[serde(rename = "provider")]
18    pub provider: Provider,
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<Language>,
22    /// The WebSocket URL that the transcriber connects to.
23    #[serde(rename = "realtimeUrl", skip_serializing_if = "Option::is_none")]
24    pub realtime_url: Option<String>,
25    /// Add up to 2500 characters of custom vocabulary.
26    #[serde(rename = "wordBoost", skip_serializing_if = "Option::is_none")]
27    pub word_boost: Option<Vec<String>>,
28    /// The duration of the end utterance silence threshold in milliseconds.
29    #[serde(rename = "endUtteranceSilenceThreshold", skip_serializing_if = "Option::is_none")]
30    pub end_utterance_silence_threshold: Option<f64>,
31    /// Disable partial transcripts. Set to `true` to not receive partial transcripts. Defaults to `false`.
32    #[serde(rename = "disablePartialTranscripts", skip_serializing_if = "Option::is_none")]
33    pub disable_partial_transcripts: Option<bool>,
34}
35
36impl AssemblyAiTranscriber {
37    pub fn new(provider: Provider) -> AssemblyAiTranscriber {
38        AssemblyAiTranscriber {
39            provider,
40            language: None,
41            realtime_url: None,
42            word_boost: None,
43            end_utterance_silence_threshold: None,
44            disable_partial_transcripts: None,
45        }
46    }
47}
48/// This is the transcription provider that will be used.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Provider {
51    #[serde(rename = "assembly-ai")]
52    AssemblyAi,
53}
54
55impl Default for Provider {
56    fn default() -> Provider {
57        Self::AssemblyAi
58    }
59}
60/// This is the language that will be set for the transcription.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Language {
63    #[serde(rename = "en")]
64    En,
65}
66
67impl Default for Language {
68    fn default() -> Language {
69        Self::En
70    }
71}
72