vapi_client/models/
knowledge_base_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 KnowledgeBaseCost {
16    /// This is the type of cost, always 'knowledge-base' for this class.
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    /// This is the model that was used for processing the knowledge base.
20    #[serde(rename = "model")]
21    pub model: serde_json::Value,
22    /// This is the number of prompt tokens used in the knowledge base query.
23    #[serde(rename = "promptTokens")]
24    pub prompt_tokens: f64,
25    /// This is the number of completion tokens generated in the knowledge base query.
26    #[serde(rename = "completionTokens")]
27    pub completion_tokens: f64,
28    /// This is the cost of the component in USD.
29    #[serde(rename = "cost")]
30    pub cost: f64,
31}
32
33impl KnowledgeBaseCost {
34    pub fn new(
35        r#type: TypeTrue,
36        model: serde_json::Value,
37        prompt_tokens: f64,
38        completion_tokens: f64,
39        cost: f64,
40    ) -> KnowledgeBaseCost {
41        KnowledgeBaseCost {
42            r#type,
43            model,
44            prompt_tokens,
45            completion_tokens,
46            cost,
47        }
48    }
49}
50/// This is the type of cost, always 'knowledge-base' for this class.
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum TypeTrue {
53    #[serde(rename = "knowledge-base")]
54    KnowledgeBase,
55}
56
57impl Default for TypeTrue {
58    fn default() -> TypeTrue {
59        Self::KnowledgeBase
60    }
61}