Skip to main content

hanzo_client/models/
model_stat.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
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 ModelStat {
16    /// tokens it answered with
17    #[serde(rename = "completionTokens", skip_serializing_if = "Option::is_none")]
18    pub completion_tokens: Option<i32>,
19    /// what this model cost, in cents
20    #[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
21    pub cost_cents: Option<i32>,
22    /// share of total spend, 0..100
23    #[serde(rename = "costPct", skip_serializing_if = "Option::is_none")]
24    pub cost_pct: Option<f64>,
25    /// share of its calls that failed, 0..1
26    #[serde(rename = "errorRate", skip_serializing_if = "Option::is_none")]
27    pub error_rate: Option<f64>,
28    /// calls to it that did not succeed
29    #[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
30    pub errors: Option<i32>,
31    /// the model this row is about, or \"other\" for the fold
32    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
33    pub model: Option<String>,
34    /// >0 only on the \"other\" fold
35    #[serde(rename = "modelCount", skip_serializing_if = "Option::is_none")]
36    pub model_count: Option<i32>,
37    /// median latency, null when no spans carry it
38    #[serde(rename = "p50Ms", skip_serializing_if = "Option::is_none")]
39    pub p50_ms: Option<f64>,
40    /// 95th-percentile latency, null when unknown
41    #[serde(rename = "p95Ms", skip_serializing_if = "Option::is_none")]
42    pub p95_ms: Option<f64>,
43    /// 99th-percentile latency, null when unknown
44    #[serde(rename = "p99Ms", skip_serializing_if = "Option::is_none")]
45    pub p99_ms: Option<f64>,
46    /// tokens sent to it
47    #[serde(rename = "promptTokens", skip_serializing_if = "Option::is_none")]
48    pub prompt_tokens: Option<i32>,
49    /// who serves it
50    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
51    pub provider: Option<String>,
52    /// calls to this model in the window
53    #[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
54    pub requests: Option<i32>,
55    /// prompt plus completion
56    #[serde(rename = "totalTokens", skip_serializing_if = "Option::is_none")]
57    pub total_tokens: Option<i32>,
58}
59
60impl ModelStat {
61    pub fn new() -> ModelStat {
62        ModelStat {
63            completion_tokens: None,
64            cost_cents: None,
65            cost_pct: None,
66            error_rate: None,
67            errors: None,
68            model: None,
69            model_count: None,
70            p50_ms: None,
71            p95_ms: None,
72            p99_ms: None,
73            prompt_tokens: None,
74            provider: None,
75            requests: None,
76            total_tokens: None,
77        }
78    }
79}
80