MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / parse_cache_telemetry_timestamp

Function parse_cache_telemetry_timestamp

crates/python/src/py_adaptive.rs:270–279  ·  view source on GitHub ↗
(timestamp: Option<&str>)

Source from the content-addressed store, hash-verified

268}
269
270fn parse_cache_telemetry_timestamp(timestamp: Option<&str>) -> PyResult<DateTime<Utc>> {
271 match timestamp {
272 Some(value) => DateTime::parse_from_rfc3339(value)
273 .map(|value| value.with_timezone(&Utc))
274 .map_err(|e| {
275 pyo3::exceptions::PyValueError::new_err(format!("invalid timestamp: {e}"))
276 }),
277 None => Ok(Utc::now()),
278 }
279}
280
281fn parse_annotated_request(value: &Bound<'_, PyAny>) -> PyResult<AnnotatedLLMRequest> {
282 if let Ok(value) = value.extract::<PyAnnotatedLLMRequest>() {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected