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