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