Skip to content

Commit b1d9517

Browse files
authored
(feat): Add support for batch file reading in fs_read tool (#2223)
* batch fs read feat * print exectuetion res in every invoke * add a mix output type * recover remote bin * clear print res function * fix ut * remove print * polish tool spec * made operations be not optional
1 parent 6b0fd5c commit b1d9517

File tree

5 files changed

+487
-155
lines changed

5 files changed

+487
-155
lines changed

crates/chat-cli/src/cli/chat/message.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ impl From<InvokeOutput> for ToolUseResultBlock {
305305
OutputKind::Text(text) => Self::Text(text),
306306
OutputKind::Json(value) => Self::Json(value),
307307
OutputKind::Images(_) => Self::Text("See images data supplied".to_string()),
308+
OutputKind::Mixed { text, .. } => ToolUseResultBlock::Text(text),
308309
}
309310
}
310311
}

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ const TRUST_ALL_TEXT: &str = color_print::cstr! {"<green!>All tools are now trus
378378
const TOOL_BULLET: &str = " ● ";
379379
const CONTINUATION_LINE: &str = " ⋮ ";
380380
const PURPOSE_ARROW: &str = " ↳ ";
381+
const SUCCESS_TICK: &str = " ✓ ";
382+
const ERROR_EXCLAMATION: &str = " ❗ ";
381383

382384
/// Enum used to denote the origin of a tool use event
383385
enum ToolUseStatus {
@@ -1580,6 +1582,10 @@ impl ChatSession {
15801582
OutputKind::Images(ref image) => {
15811583
image_blocks.extend(image.clone());
15821584
},
1585+
OutputKind::Mixed { ref text, ref images } => {
1586+
debug!("Output is Mixed: text = {:?}, images = {}", text, images.len());
1587+
image_blocks.extend(images.clone());
1588+
},
15831589
}
15841590

15851591
debug!("tool result output: {:#?}", result);

0 commit comments

Comments
 (0)