(
state: &mut ExecutionLoopState,
tool_id: &str,
output: &str,
is_error: bool,
images: Vec<Attachment>,
)
| 99 | } |
| 100 | |
| 101 | pub(super) fn push_tool_result_message( |
| 102 | state: &mut ExecutionLoopState, |
| 103 | tool_id: &str, |
| 104 | output: &str, |
| 105 | is_error: bool, |
| 106 | images: Vec<Attachment>, |
| 107 | ) { |
| 108 | if images.is_empty() { |
| 109 | state |
| 110 | .messages |
| 111 | .push(Message::tool_result(tool_id, output, is_error)); |
| 112 | } else { |
| 113 | state.messages.push(Message::tool_result_with_images( |
| 114 | tool_id, output, &images, is_error, |
| 115 | )); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | #[cfg(test)] |
| 120 | mod tests { |
no test coverage detected