langfuse_rs/models/
usage_by_model.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/// UsageByModel : Daily usage of a given model. Usage corresponds to the unit set for the specific model (e.g. tokens).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UsageByModel {
17	#[serde(
18		rename = "model",
19		default,
20		with = "::serde_with::rust::double_option",
21		skip_serializing_if = "Option::is_none"
22	)]
23	pub model: Option<Option<String>>,
24	/// Total number of generation input units (e.g. tokens)
25	#[serde(rename = "inputUsage")]
26	pub input_usage: i32,
27	/// Total number of generation output units (e.g. tokens)
28	#[serde(rename = "outputUsage")]
29	pub output_usage: i32,
30	/// Total number of generation total units (e.g. tokens)
31	#[serde(rename = "totalUsage")]
32	pub total_usage: i32,
33	#[serde(rename = "countTraces")]
34	pub count_traces: i32,
35	#[serde(rename = "countObservations")]
36	pub count_observations: i32,
37	/// Total model cost in USD
38	#[serde(rename = "totalCost")]
39	pub total_cost: f64,
40}
41
42impl UsageByModel {
43	/// Daily usage of a given model. Usage corresponds to the unit set for the specific model (e.g. tokens).
44	pub fn new(input_usage: i32, output_usage: i32, total_usage: i32, count_traces: i32, count_observations: i32, total_cost: f64) -> UsageByModel {
45		UsageByModel {
46			model: None,
47			input_usage,
48			output_usage,
49			total_usage,
50			count_traces,
51			count_observations,
52			total_cost,
53		}
54	}
55}