MCPcopy Index your code
hub / github.com/AI45Lab/Code / py_to_step_spec

Function py_to_step_spec

sdk/python/src/lib.rs:3458–3461  ·  view source on GitHub ↗

Convert a Python spec dict into an `AgentStepSpec` (snake_case keys) via a JSON round-trip.

(py: Python<'_>, obj: &Bound<'_, PyAny>)

Source from the content-addressed store, hash-verified

3456/// Convert a Python spec dict into an `AgentStepSpec` (snake_case keys) via a
3457/// JSON round-trip.
3458fn py_to_step_spec(py: Python<'_>, obj: &Bound<'_, PyAny>) -> PyResult<RustAgentStepSpec> {
3459 serde_json::from_str(&py_dumps(py, obj)?)
3460 .map_err(|e| PyValueError::new_err(format!("invalid AgentStepSpec: {e}")))
3461}
3462
3463/// Convert an arbitrary Python value into a `serde_json::Value`.
3464fn py_to_json_value(py: Python<'_>, obj: &Bound<'_, PyAny>) -> PyResult<serde_json::Value> {

Calls 1

py_dumpsFunction · 0.85