MCPcopy Create free account
hub / github.com/AI45Lab/Code / py_to_step_spec_parses_full_dict

Function py_to_step_spec_parses_full_dict

sdk/python/src/lib.rs:7429–7451  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7427
7428 #[test]
7429 fn py_to_step_spec_parses_full_dict() {
7430 pyo3::prepare_freethreaded_python();
7431 Python::with_gil(|py| {
7432 let dict = PyDict::new(py);
7433 dict.set_item("task_id", "t1").unwrap();
7434 dict.set_item("agent", "explore").unwrap();
7435 dict.set_item("description", "d").unwrap();
7436 dict.set_item("prompt", "p").unwrap();
7437 dict.set_item("max_steps", 5u32).unwrap();
7438 dict.set_item("parent_session_id", "parent").unwrap();
7439 let schema = PyDict::new(py);
7440 schema.set_item("type", "object").unwrap();
7441 dict.set_item("output_schema", &schema).unwrap();
7442
7443 let spec = py_to_step_spec(py, dict.as_any()).unwrap();
7444 assert_eq!(spec.task_id, "t1");
7445 assert_eq!(spec.agent, "explore");
7446 assert_eq!(spec.prompt, "p");
7447 assert_eq!(spec.max_steps, Some(5));
7448 assert_eq!(spec.parent_session_id.as_deref(), Some("parent"));
7449 assert!(spec.output_schema.is_some());
7450 });
7451 }
7452
7453 #[test]
7454 fn py_to_step_spec_minimal_defaults_optionals() {

Callers

nothing calls this directly

Calls 1

py_to_step_specFunction · 0.85

Tested by

no test coverage detected