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