fix: Face processor now saves status and total_faces to face.json
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TokenUsage {
|
||||
pub input_tokens: u32,
|
||||
pub output_tokens: u32,
|
||||
pub total_tokens: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct LogTokenUsage {
|
||||
pub request_id: String,
|
||||
pub key_id: Option<String>,
|
||||
pub service: String,
|
||||
pub model: Option<String>,
|
||||
pub endpoint: Option<String>,
|
||||
pub input_tokens: u32,
|
||||
pub output_tokens: u32,
|
||||
pub total_tokens: u32,
|
||||
pub duration_ms: Option<i32>,
|
||||
pub status_code: Option<i32>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct BillingPeriod {
|
||||
pub id: i32,
|
||||
pub key_id: Option<String>,
|
||||
pub period_month: String,
|
||||
pub total_input_tokens: i64,
|
||||
pub total_output_tokens: i64,
|
||||
pub total_tokens: i64,
|
||||
pub request_count: i64,
|
||||
pub error_count: i64,
|
||||
pub service_breakdown: serde_json::Value,
|
||||
pub model_breakdown: serde_json::Value,
|
||||
pub avg_duration_ms: Option<i32>,
|
||||
pub total_duration_ms: Option<i64>,
|
||||
pub period_start: String,
|
||||
pub period_end: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct UsageResponse {
|
||||
pub key_id: Option<String>,
|
||||
pub period: String,
|
||||
pub tokens: TokenStats,
|
||||
pub services: serde_json::Value,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TokenStats {
|
||||
pub input: i64,
|
||||
pub output: i64,
|
||||
pub total: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct HistoryResponse {
|
||||
pub periods: Vec<PeriodSummary>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PeriodSummary {
|
||||
pub period: String,
|
||||
pub total_tokens: i64,
|
||||
pub request_count: i64,
|
||||
}
|
||||
Reference in New Issue
Block a user