vapi_client/models/
analysis_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 AnalysisCost {
16    /// This is the type of cost, always 'analysis' for this class.
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    /// This is the type of analysis performed.
20    #[serde(rename = "analysisType")]
21    pub analysis_type: AnalysisTypeTrue,
22    /// This is the model that was used to perform the analysis.
23    #[serde(rename = "model")]
24    pub model: serde_json::Value,
25    /// This is the number of prompt tokens used in the analysis.
26    #[serde(rename = "promptTokens")]
27    pub prompt_tokens: f64,
28    /// This is the number of completion tokens generated in the analysis.
29    #[serde(rename = "completionTokens")]
30    pub completion_tokens: f64,
31    /// This is the cost of the component in USD.
32    #[serde(rename = "cost")]
33    pub cost: f64,
34}
35
36impl AnalysisCost {
37    pub fn new(
38        r#type: TypeTrue,
39        analysis_type: AnalysisTypeTrue,
40        model: serde_json::Value,
41        prompt_tokens: f64,
42        completion_tokens: f64,
43        cost: f64,
44    ) -> AnalysisCost {
45        AnalysisCost {
46            r#type,
47            analysis_type,
48            model,
49            prompt_tokens,
50            completion_tokens,
51            cost,
52        }
53    }
54}
55/// This is the type of cost, always 'analysis' for this class.
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum TypeTrue {
58    #[serde(rename = "analysis")]
59    Analysis,
60}
61
62impl Default for TypeTrue {
63    fn default() -> TypeTrue {
64        Self::Analysis
65    }
66}
67/// This is the type of analysis performed.
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum AnalysisTypeTrue {
70    #[serde(rename = "summary")]
71    Summary,
72    #[serde(rename = "structuredData")]
73    StructuredData,
74    #[serde(rename = "successEvaluation")]
75    SuccessEvaluation,
76}
77
78impl Default for AnalysisTypeTrue {
79    fn default() -> AnalysisTypeTrue {
80        Self::Summary
81    }
82}