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: Type,
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: Provider,
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(r#type: Type, model: serde_json::Value, provider: Provider, prompt_text_tokens: f64, prompt_audio_tokens: f64, completion_text_tokens: f64, completion_audio_tokens: f64, cost: f64) -> VoicemailDetectionCost {
44        VoicemailDetectionCost {
45            r#type,
46            model,
47            provider,
48            prompt_text_tokens,
49            prompt_audio_tokens,
50            completion_text_tokens,
51            completion_audio_tokens,
52            cost,
53        }
54    }
55}
56/// This is the type of cost, always 'voicemail-detection' for this class.
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59    #[serde(rename = "voicemail-detection")]
60    VoicemailDetection,
61}
62
63impl Default for Type {
64    fn default() -> Type {
65        Self::VoicemailDetection
66    }
67}
68/// This is the provider that was used to detect the voicemail.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum Provider {
71    #[serde(rename = "twilio")]
72    Twilio,
73    #[serde(rename = "google")]
74    Google,
75    #[serde(rename = "openai")]
76    Openai,
77}
78
79impl Default for Provider {
80    fn default() -> Provider {
81        Self::Twilio
82    }
83}
84