assistant tools: Add Tool::icon method instead of matching on name (#27444)

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga
2025-03-25 18:17:36 +00:00
committed by GitHub
parent 0339d654d2
commit 46e86f003f
22 changed files with 98 additions and 18 deletions
+5
View File
@@ -6,6 +6,7 @@ use project::Project;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use ui::IconName;
use util::command::new_smol_command;
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
@@ -31,6 +32,10 @@ impl Tool for BashTool {
include_str!("./bash_tool/description.md").to_string()
}
fn icon(&self) -> IconName {
IconName::Terminal
}
fn input_schema(&self) -> serde_json::Value {
let schema = schemars::schema_for!(BashToolInput);
serde_json::to_value(&schema).unwrap()