vapi_client/models/
knowledge_base_cost.rs

1use serde::{Deserialize, Serialize};
2use utoipa::ToSchema;
3
4/// Example knowledge-base cost struct to match JSON like:
5/// {
6///   "cost": 0,
7///   "type": "knowledge-base",
8///   "model": {
9///     "model": "gemini-1.5-flash",
10///     "provider": "google"
11///   },
12///   "promptTokens": 0,
13///   "completionTokens": 0
14/// }
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
16pub struct KnowledgeBaseCost {
17    /// This is the cost in USD.
18    pub cost: f64,
19
20    /// The cost type (always "knowledge-base" for this struct).
21    #[serde(rename = "type")]
22    pub cost_type: crate::models::call_costs_inner::Type,
23
24    /// The model used for knowledge-base lookups.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub model: Option<KnowledgeBaseModel>,
27
28    /// The number of tokens in the prompt, if applicable.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub promptTokens: Option<u32>,
31
32    /// The number of tokens in the completion, if applicable.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub completionTokens: Option<u32>,
35}
36
37/// If you need a more detailed model structure for knowledge-base usage, define it here:
38#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
39pub struct KnowledgeBaseModel {
40    pub model: String,
41    pub provider: String,
42}