diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-15 15:27:16 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-15 15:27:16 +0100 |
| commit | 5563622557ac60b6842f6c09c4c76a5ece9f6d09 (patch) | |
| tree | 9a841885b861d8543f21d19738e7db5a663f72e5 /src/tools/mod.rs | |
| parent | 0.3.0: --version and --doctor (diff) | |
| download | agent686-5563622557ac60b6842f6c09c4c76a5ece9f6d09.tar.gz agent686-5563622557ac60b6842f6c09c4c76a5ece9f6d09.zip | |
0.4.0: grep takes a regular expression, fixed=true for literals
Invalid patterns explain themselves and point at fixed, rather than failing with
a bare regex error the model cannot act on.
Diffstat (limited to '')
| -rw-r--r-- | src/tools/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/mod.rs b/src/tools/mod.rs index 503de08..7a1a26d 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs | |||
| @@ -117,13 +117,14 @@ pub fn schemas() -> Vec<Value> { | |||
| 117 | "type": "function", | 117 | "type": "function", |
| 118 | "function": { | 118 | "function": { |
| 119 | "name": "grep", | 119 | "name": "grep", |
| 120 | "description": "Search file contents for a literal string, recursively. Skips .git, target, node_modules and similar.", | 120 | "description": "Search file contents recursively with a regular expression. Skips .git, target, node_modules and similar. Set fixed=true to match literal text instead.", |
| 121 | "parameters": { | 121 | "parameters": { |
| 122 | "type": "object", | 122 | "type": "object", |
| 123 | "properties": { | 123 | "properties": { |
| 124 | "pattern": { "type": "string" }, | 124 | "pattern": { "type": "string", "description": "regular expression, or literal text when fixed=true" }, |
| 125 | "path": { "type": "string", "description": "file or directory (default .)" }, | 125 | "path": { "type": "string", "description": "file or directory (default .)" }, |
| 126 | "ignore_case": { "type": "boolean" } | 126 | "ignore_case": { "type": "boolean" }, |
| 127 | "fixed": { "type": "boolean", "description": "treat pattern as literal text" } | ||
| 127 | }, | 128 | }, |
| 128 | "required": ["pattern"] | 129 | "required": ["pattern"] |
| 129 | } | 130 | } |
