vapi_client/models/
analysis_cost.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AnalysisCost {
17    /// This is the type of cost, always 'analysis' for this class.
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// This is the type of analysis performed.
21    #[serde(rename = "analysisType")]
22    pub analysis_type: AnalysisType,
23    /// This is the model that was used to perform the analysis.
24    #[serde(rename = "model")]
25    pub model: serde_json::Value,
26    /// This is the number of prompt tokens used in the analysis.
27    #[serde(rename = "promptTokens")]
28    pub prompt_tokens: f64,
29    /// This is the number of completion tokens generated in the analysis.
30    #[serde(rename = "completionTokens")]
31    pub completion_tokens: f64,
32    /// This is the cost of the component in USD.
33    #[serde(rename = "cost")]
34    pub cost: f64,
35}
36
37impl AnalysisCost {
38    pub fn new(
39        r#type: Type,
40        analysis_type: AnalysisType,
41        model: serde_json::Value,
42        prompt_tokens: f64,
43        completion_tokens: f64,
44        cost: f64,
45    ) -> AnalysisCost {
46        AnalysisCost {
47            r#type,
48            analysis_type,
49            model,
50            prompt_tokens,
51            completion_tokens,
52            cost,
53        }
54    }
55}
56/// This is the type of cost, always 'analysis' for this class.
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59    #[serde(rename = "analysis")]
60    Analysis,
61}
62
63impl Default for Type {
64    fn default() -> Type {
65        Self::Analysis
66    }
67}
68/// This is the type of analysis performed.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum AnalysisType {
71    #[serde(rename = "summary")]
72    Summary,
73    #[serde(rename = "structuredData")]
74    StructuredData,
75    #[serde(rename = "successEvaluation")]
76    SuccessEvaluation,
77}
78
79impl Default for AnalysisType {
80    fn default() -> AnalysisType {
81        Self::Summary
82    }
83}