bitrouter-api 0.24.2

BitRouter API - reusable warp server components for AI model routing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#[cfg(feature = "openai")]
use std::time::{SystemTime, UNIX_EPOCH};

/// Generates a hex-encoded timestamp-based ID.
#[cfg(feature = "openai")]
pub(crate) fn generate_id() -> String {
    let nanos = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap_or_default()
        .as_nanos();
    format!("{nanos:x}")
}