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

Function parse_annotated_request

crates/python/src/py_adaptive.rs:281–290  ·  view source on GitHub ↗
(value: &Bound<'_, PyAny>)

Source from the content-addressed store, hash-verified

279}
280
281fn parse_annotated_request(value: &Bound<'_, PyAny>) -> PyResult<AnnotatedLLMRequest> {
282 if let Ok(value) = value.extract::<PyAnnotatedLLMRequest>() {
283 return Ok(value.inner);
284 }
285
286 let annotated_request = py_to_json(value)?;
287 serde_json::from_value(annotated_request).map_err(|e| {
288 pyo3::exceptions::PyValueError::new_err(format!("invalid annotated_request: {e}"))
289 })
290}
291
292fn parse_cache_request_facts(
293 value: Option<&Bound<'_, PyAny>>,

Callers 1

Calls 1

py_to_jsonFunction · 0.85

Tested by

no test coverage detected