Skip to content

Commit

Permalink
assistant_tools: Rename FileToolInput to NowToolInput (#25456)
Browse files Browse the repository at this point in the history
Renamed the `FileToolInput` structure to `NowToolInput` to better
reflect its purpose, as the tool is related to time-based operations.

Release Notes:

- N/A

Signed-off-by: Nikita Pivkin <[email protected]>
  • Loading branch information
nikpivkin authored Feb 24, 2025
1 parent 72a9429 commit bc941bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/assistant_tools/src/now_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum Timezone {
}

#[derive(Debug, Serialize, Deserialize, JsonSchema)]
pub struct FileToolInput {
pub struct NowToolInput {
/// The timezone to use for the datetime.
timezone: Timezone,
}
Expand All @@ -34,7 +34,7 @@ impl Tool for NowTool {
}

fn input_schema(&self) -> serde_json::Value {
let schema = schemars::schema_for!(FileToolInput);
let schema = schemars::schema_for!(NowToolInput);
serde_json::to_value(&schema).unwrap()
}

Expand All @@ -45,7 +45,7 @@ impl Tool for NowTool {
_window: &mut Window,
_cx: &mut App,
) -> Task<Result<String>> {
let input: FileToolInput = match serde_json::from_value(input) {
let input: NowToolInput = match serde_json::from_value(input) {
Ok(input) => input,
Err(err) => return Task::ready(Err(anyhow!(err))),
};
Expand Down

0 comments on commit bc941bf

Please sign in to comment.