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

Function parse_planning_mode

sdk/python/src/lib.rs:5825–5835  ·  view source on GitHub ↗
(mode: &str)

Source from the content-addressed store, hash-verified

5823// ============================================================================
5824
5825fn parse_planning_mode(mode: &str) -> PyResult<RustPlanningMode> {
5826 match mode.trim().to_ascii_lowercase().as_str() {
5827 "auto" => Ok(RustPlanningMode::Auto),
5828 "enabled" | "enable" | "on" | "force" | "forced" | "true" => Ok(RustPlanningMode::Enabled),
5829 "disabled" | "disable" | "off" | "false" => Ok(RustPlanningMode::Disabled),
5830 _ => Err(PyValueError::new_err(format!(
5831 "Invalid planning_mode '{}'. Expected 'auto', 'enabled', or 'disabled'",
5832 mode
5833 ))),
5834 }
5835}
5836
5837fn apply_planning_mode(
5838 opts: RustSessionOptions,

Callers 2

set_planning_modeMethod · 0.70
apply_planning_modeFunction · 0.70

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected