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    /// Transcripts below this confidence threshold will be discarded.  @default 0.4
23    #[serde(rename = "confidenceThreshold", skip_serializing_if = "Option::is_none")]
24    pub confidence_threshold: Option<f64>,
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(rename = "endUtteranceSilenceThreshold", skip_serializing_if = "Option::is_none")]
33    pub end_utterance_silence_threshold: Option<f64>,
34    /// Disable partial transcripts. Set to `true` to not receive partial transcripts. Defaults to `false`.
35    #[serde(rename = "disablePartialTranscripts", skip_serializing_if = "Option::is_none")]
36    pub disable_partial_transcripts: Option<bool>,
37    /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
38    #[serde(rename = "fallbackPlan", skip_serializing_if = "Option::is_none")]
39    pub fallback_plan: Option<models::FallbackTranscriberPlan>,
40}
41
42impl AssemblyAiTranscriber {
43    pub fn new(provider: Provider) -> AssemblyAiTranscriber {
44        AssemblyAiTranscriber {
45            provider,
46            language: None,
47            confidence_threshold: None,
48            realtime_url: None,
49            word_boost: None,
50            end_utterance_silence_threshold: None,
51            disable_partial_transcripts: None,
52            fallback_plan: None,
53        }
54    }
55}
56/// This is the transcription provider that will be used.
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Provider {
59    #[serde(rename = "assembly-ai")]
60    AssemblyAi,
61}
62
63impl Default for Provider {
64    fn default() -> Provider {
65        Self::AssemblyAi
66    }
67}
68/// This is the language that will be set for the transcription.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum Language {
71    #[serde(rename = "en")]
72    En,
73}
74
75impl Default for Language {
76    fn default() -> Language {
77        Self::En
78    }
79}
80