summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineet Kumar <git@vineetk.net>2026-05-25 23:15:50 -0400
committerVineet Kumar <git@vineetk.net>2026-05-25 23:15:50 -0400
commitc7b4b40b9793a7cd6ea51a7e10cb28c7c9e7fa93 (patch)
treebd1f271785d8bb6525dee996a2ff6053c58b0e4f
parent432d56ef45c9369bc87518b3c8d305eeb40e6dd6 (diff)
update read_file tool definition based on finalized hashline changes
-rw-r--r--llm-tools.el43
1 files changed, 37 insertions, 6 deletions
diff --git a/llm-tools.el b/llm-tools.el
index cf86b6b..56aeddd 100644
--- a/llm-tools.el
+++ b/llm-tools.el
@@ -6,10 +6,11 @@
6 :name "read_file" 6 :name "read_file"
7 :function 'llm-tools--hl-file-read 7 :function 'llm-tools--hl-file-read
8 :description "\ 8 :description "\
9Read an entire file and return its contents in hashline format. Each 9Read a file (or a range of lines) and return its contents in hashline
10line is represented as LINE_NUMBER HASH|CONTENT, where LINE_NUMBER is 10format. Each line is represented as LINE_NUMBER HASH|CONTENT, where
11the 1-based line number, HASH is a 2-character content-derived bigram, 11LINE_NUMBER is nthe 1-based line number, HASH is a 2-character
12and CONTENT is the verbatim line text. Example output: 12content-derived bigram, and CONTENT is the verbatim line text. Example
13output:
13 14
141aa|const char *TITLE = \"Mr\"; 151aa|const char *TITLE = \"Mr\";
152ab|void greet(char *name) { 162ab|void greet(char *name) {
@@ -20,10 +21,40 @@ uniquely identifies a line by position and content. Copy anchors
20verbatim from the output when referencing lines in edit operations. Do 21verbatim from the output when referencing lines in edit operations. Do
21not fabricate or modify hashes. Call this tool before editing any file 22not fabricate or modify hashes. Call this tool before editing any file
22to obtain current content and valid anchors. Re-call if anchors no 23to obtain current content and valid anchors. Re-call if anchors no
23longer match after external changes." 24longer match after external changes.
25
26Use optional BEG and END arguments to read only a specific range of
27lines (1-based, inclusive). Use ONLY_ANCHORS to retrieve just the line
28anchors without content. Use AS_LIST to receive output as a list rather
29than a newline-delimited string."
24 :args '((:name "file" 30 :args '((:name "file"
25 :type string 31 :type string
26 :description "Path to the file to read, relative to the working directory.")) 32 :description "\
33Path to the file to read, relative to the working directory.")
34 (:name "beg"
35 :type integer
36 :description "\
37Optional 1-based line number (inclusive) to start reading from. Omit to
38read from the beginning."
39 :optional t)
40 (:name "end"
41 :type integer
42 :description "\
43Optional 1-based line number (inclusive) to stop reading at. Omit to
44read to the end."
45 :optional t)
46 (:name "only_anchors"
47 :type boolean
48 :description "\
49Optional boolean. When true, returns only the anchor (line number +
50hash) without the content portion after the pipe."
51 :optional t)
52 (:name "as_list"
53 :type boolean
54 :description "\
55Optional boolean. When true, returns each hashline as a list element
56instead of a single newline-delimited string."
57 :optional t))
27 :async nil 58 :async nil
28 :confirm nil 59 :confirm nil
29 :include t) 60 :include t)