(response: &Value)
| 398 | } |
| 399 | |
| 400 | fn extract_tool_output(response: &Value) -> Option<String> { |
| 401 | if let Some(text) = response.as_str() { |
| 402 | return Some(text.to_string()); |
| 403 | } |
| 404 | for key in ["output", "content", "result", "stdout", "message"] { |
| 405 | if let Some(text) = response.get(key).and_then(Value::as_str) { |
| 406 | return Some(text.to_string()); |
| 407 | } |
| 408 | } |
| 409 | // Fall back to compact JSON when the result is structured. |
| 410 | serde_json::to_string(response).ok() |
| 411 | } |
| 412 | |
| 413 | fn extract_file_path(tool_input: Option<&Value>) -> Option<String> { |
| 414 | let value = tool_input?; |
no test coverage detected