langfuse_client/models/
open_ai_usage.rs

1/*
2 * langfuse
3 *
4 * ## Authentication  Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings:  - username: Langfuse Public Key - password: Langfuse Secret Key  ## Exports  - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
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/// OpenAiUsage : Usage interface of OpenAI for improved compatibility.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OpenAiUsage {
17    #[serde(rename = "promptTokens", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub prompt_tokens: Option<Option<i32>>,
19    #[serde(rename = "completionTokens", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub completion_tokens: Option<Option<i32>>,
21    #[serde(rename = "totalTokens", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub total_tokens: Option<Option<i32>>,
23}
24
25impl OpenAiUsage {
26    /// Usage interface of OpenAI for improved compatibility.
27    pub fn new() -> OpenAiUsage {
28        OpenAiUsage {
29            prompt_tokens: None,
30            completion_tokens: None,
31            total_tokens: None,
32        }
33    }
34}
35