vapi_client/models/
knowledge_base_cost.rs

1/*
2 * Vapi API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document:
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 model that was used to perform the knowledge-base lookup.
17    #[serde(rename = "model")]
18    pub model: std::collections::HashMap<String, serde_json::Value>,
19
20    /// This is the number of prompt tokens used for knowledge-base.
21    #[serde(rename = "promptTokens")]
22    pub prompt_tokens: f64,
23
24    /// This is the number of completion tokens returned from knowledge-base.
25    #[serde(rename = "completionTokens")]
26    pub completion_tokens: f64,
27
28    /// This is the cost of the knowledge-base component in USD.
29    #[serde(rename = "cost")]
30    pub cost: f64,
31
32    #[serde(rename = "type")]
33    pub r#type: Type,
34}
35
36impl KnowledgeBaseCost {
37    pub fn new(
38        model: std::collections::HashMap<String, serde_json::Value>,
39        prompt_tokens: f64,
40        completion_tokens: f64,
41        cost: f64,
42        r#type: Type,
43    ) -> KnowledgeBaseCost {
44        KnowledgeBaseCost {
45            model,
46            prompt_tokens,
47            completion_tokens,
48            cost,
49            r#type,
50        }
51    }
52}
53
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum Type {
56    #[serde(rename = "knowledge-base")]
57    KnowledgeBase,
58}
59
60impl Default for Type {
61    fn default() -> Type {
62        Self::KnowledgeBase
63    }
64}