Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Simplify tool schemas for enums (#55763)

Bennet Bo Fenner9955c4579d54
diff --git a/crates/agent/src/tools/edit_file_tool.rs b/crates/agent/src/tools/edit_file_tool.rs
index 0e6493953c9..234b4ac92f2 100644
--- a/crates/agent/src/tools/edit_file_tool.rs
+++ b/crates/agent/src/tools/edit_file_tool.rs
@@ -94,10 +94,7 @@ pub struct EditFileToolInput {
#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum EditFileMode {
- /// Overwrite the file with new content (replacing any existing content).
- /// If the file does not exist, it will be created.
Write,
- /// Make granular edits to an existing file
Edit,
}
diff --git a/crates/agent/src/tools/now_tool.rs b/crates/agent/src/tools/now_tool.rs
index f8f4e0d91b5..4032731097c 100644
--- a/crates/agent/src/tools/now_tool.rs
+++ b/crates/agent/src/tools/now_tool.rs
@@ -12,10 +12,8 @@ use crate::{AgentTool, ToolCallEventStream, ToolInput};
#[serde(rename_all = "snake_case")]
#[schemars(inline)]
pub enum Timezone {
- /// Use UTC for the datetime.
#[serde(alias = "UTC", alias = "Utc")]
Utc,
- /// Use local time for the datetime.
#[serde(alias = "LOCAL", alias = "Local")]
Local,
}
@@ -24,7 +22,7 @@ pub enum Timezone {
/// Only use this tool when the user specifically asks for it or the current task would benefit from knowing the current datetime.
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
pub struct NowToolInput {
- /// The timezone to use for the datetime.
+ /// The timezone to use for the datetime. Use `utc` for UTC, or `local` for the system's local time.
timezone: Timezone,
}