hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * 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/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ModelStat {
    /// tokens it answered with
    #[serde(rename = "completionTokens", skip_serializing_if = "Option::is_none")]
    pub completion_tokens: Option<i32>,
    /// what this model cost, in cents
    #[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
    pub cost_cents: Option<i32>,
    /// share of total spend, 0..100
    #[serde(rename = "costPct", skip_serializing_if = "Option::is_none")]
    pub cost_pct: Option<f64>,
    /// share of its calls that failed, 0..1
    #[serde(rename = "errorRate", skip_serializing_if = "Option::is_none")]
    pub error_rate: Option<f64>,
    /// calls to it that did not succeed
    #[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
    pub errors: Option<i32>,
    /// the model this row is about, or \"other\" for the fold
    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    /// >0 only on the \"other\" fold
    #[serde(rename = "modelCount", skip_serializing_if = "Option::is_none")]
    pub model_count: Option<i32>,
    /// median latency, null when no spans carry it
    #[serde(rename = "p50Ms", skip_serializing_if = "Option::is_none")]
    pub p50_ms: Option<f64>,
    /// 95th-percentile latency, null when unknown
    #[serde(rename = "p95Ms", skip_serializing_if = "Option::is_none")]
    pub p95_ms: Option<f64>,
    /// 99th-percentile latency, null when unknown
    #[serde(rename = "p99Ms", skip_serializing_if = "Option::is_none")]
    pub p99_ms: Option<f64>,
    /// tokens sent to it
    #[serde(rename = "promptTokens", skip_serializing_if = "Option::is_none")]
    pub prompt_tokens: Option<i32>,
    /// who serves it
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<String>,
    /// calls to this model in the window
    #[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
    pub requests: Option<i32>,
    /// prompt plus completion
    #[serde(rename = "totalTokens", skip_serializing_if = "Option::is_none")]
    pub total_tokens: Option<i32>,
}

impl ModelStat {
    pub fn new() -> ModelStat {
        ModelStat {
            completion_tokens: None,
            cost_cents: None,
            cost_pct: None,
            error_rate: None,
            errors: None,
            model: None,
            model_count: None,
            p50_ms: None,
            p95_ms: None,
            p99_ms: None,
            prompt_tokens: None,
            provider: None,
            requests: None,
            total_tokens: None,
        }
    }
}