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: Type,
19    /// This is the type of analysis performed.
20    #[serde(rename = "analysisType")]
21    pub analysis_type: AnalysisType,
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(r#type: Type, analysis_type: AnalysisType, model: serde_json::Value, prompt_tokens: f64, completion_tokens: f64, cost: f64) -> AnalysisCost {
38        AnalysisCost {
39            r#type,
40            analysis_type,
41            model,
42            prompt_tokens,
43            completion_tokens,
44            cost,
45        }
46    }
47}
48/// This is the type of cost, always 'analysis' for this class.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Type {
51    #[serde(rename = "analysis")]
52    Analysis,
53}
54
55impl Default for Type {
56    fn default() -> Type {
57        Self::Analysis
58    }
59}
60/// This is the type of analysis performed.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum AnalysisType {
63    #[serde(rename = "summary")]
64    Summary,
65    #[serde(rename = "structuredData")]
66    StructuredData,
67    #[serde(rename = "successEvaluation")]
68    SuccessEvaluation,
69}
70
71impl Default for AnalysisType {
72    fn default() -> AnalysisType {
73        Self::Summary
74    }
75}
76