vapi_client/models/
voicemail_detection_cost.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 VoicemailDetectionCost {
16    /// This is the type of cost, always 'voicemail-detection' for this class.
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    /// This is the model that was used to perform the analysis.
20    #[serde(rename = "model")]
21    pub model: serde_json::Value,
22    /// This is the provider that was used to detect the voicemail.
23    #[serde(rename = "provider")]
24    pub provider: ProviderTrue,
25    /// This is the number of prompt text tokens used in the voicemail detection.
26    #[serde(rename = "promptTextTokens")]
27    pub prompt_text_tokens: f64,
28    /// This is the number of prompt audio tokens used in the voicemail detection.
29    #[serde(rename = "promptAudioTokens")]
30    pub prompt_audio_tokens: f64,
31    /// This is the number of completion text tokens used in the voicemail detection.
32    #[serde(rename = "completionTextTokens")]
33    pub completion_text_tokens: f64,
34    /// This is the number of completion audio tokens used in the voicemail detection.
35    #[serde(rename = "completionAudioTokens")]
36    pub completion_audio_tokens: f64,
37    /// This is the cost of the component in USD.
38    #[serde(rename = "cost")]
39    pub cost: f64,
40}
41
42impl VoicemailDetectionCost {
43    pub fn new(
44        r#type: TypeTrue,
45        model: serde_json::Value,
46        provider: ProviderTrue,
47        prompt_text_tokens: f64,
48        prompt_audio_tokens: f64,
49        completion_text_tokens: f64,
50        completion_audio_tokens: f64,
51        cost: f64,
52    ) -> VoicemailDetectionCost {
53        VoicemailDetectionCost {
54            r#type,
55            model,
56            provider,
57            prompt_text_tokens,
58            prompt_audio_tokens,
59            completion_text_tokens,
60            completion_audio_tokens,
61            cost,
62        }
63    }
64}
65/// This is the type of cost, always 'voicemail-detection' for this class.
66#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum TypeTrue {
68    #[serde(rename = "voicemail-detection")]
69    VoicemailDetection,
70}
71
72impl Default for TypeTrue {
73    fn default() -> TypeTrue {
74        Self::VoicemailDetection
75    }
76}
77/// This is the provider that was used to detect the voicemail.
78#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum ProviderTrue {
80    #[serde(rename = "twilio")]
81    Twilio,
82    #[serde(rename = "google")]
83    Google,
84    #[serde(rename = "openai")]
85    Openai,
86    #[serde(rename = "vapi")]
87    Vapi,
88}
89
90impl Default for ProviderTrue {
91    fn default() -> ProviderTrue {
92        Self::Twilio
93    }
94}