assistant tools: Add Tool::icon
method instead of matching on name (#27444)
Release Notes: - N/A
This commit is contained in:
parent
0339d654d2
commit
46e86f003f
22 changed files with 98 additions and 18 deletions
|
@ -8,6 +8,7 @@ use language_model::LanguageModelRequestMessage;
|
|||
use project::Project;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ui::IconName;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
|
@ -39,6 +40,10 @@ impl Tool for NowTool {
|
|||
"Returns the current datetime in RFC 3339 format. Only use this tool when the user specifically asks for it or the current task would benefit from knowing the current datetime.".into()
|
||||
}
|
||||
|
||||
fn icon(&self) -> IconName {
|
||||
IconName::Info
|
||||
}
|
||||
|
||||
fn input_schema(&self) -> serde_json::Value {
|
||||
let schema = schemars::schema_for!(NowToolInput);
|
||||
serde_json::to_value(&schema).unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue