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

Function parse_py_timeout_action

sdk/python/src/lib.rs:4462–4470  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

4460}
4461
4462fn parse_py_timeout_action(value: &str) -> PyResult<RustTimeoutAction> {
4463 match value.trim().to_ascii_lowercase().replace('-', "_").as_str() {
4464 "reject" => Ok(RustTimeoutAction::Reject),
4465 "auto_approve" | "autoapprove" => Ok(RustTimeoutAction::AutoApprove),
4466 other => Err(PyValueError::new_err(format!(
4467 "timeout_action must be 'reject' or 'auto_approve', got {other:?}"
4468 ))),
4469 }
4470}
4471
4472fn py_confirmation_policy_to_rust(
4473 policy: PyConfirmationPolicy,

Callers 1

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected