Sanitize a single tool-call-like object: use parameters_masked as parameters and output_masked as output when present, then remove the _masked keys.
(entry: &mut serde_json::Value)
| 14 | /// Sanitize a single tool-call-like object: use parameters_masked as parameters and |
| 15 | /// output_masked as output when present, then remove the _masked keys. |
| 16 | fn sanitize_tool_call_entry(entry: &mut serde_json::Value) { |
| 17 | if let Some(obj) = entry.as_object_mut() { |
| 18 | if let Some(pm) = obj.remove("parameters_masked") { |
| 19 | obj.insert("parameters".to_string(), pm); |
| 20 | } |
| 21 | if let Some(om) = obj.remove("output_masked") { |
| 22 | obj.insert("output".to_string(), om); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | /// Sanitize a node so that tool call parameters and output exposed in metadata are masked. |
| 28 | /// Applies to executions[].type=="tool_call", node["tool_calls"], and node["initial_response"]["tool_calls"]. |
no test coverage detected