(timestamp: Option<&str>)
| 268 | } |
| 269 | |
| 270 | fn 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 | |
| 281 | fn parse_annotated_request(value: &Bound<'_, PyAny>) -> PyResult<AnnotatedLLMRequest> { |
| 282 | if let Ok(value) = value.extract::<PyAnnotatedLLMRequest>() { |
no outgoing calls
no test coverage detected