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