branch: externals/ellama
commit efde4553a68798b2977f486cc28d35457ba6da22
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>
Fix directory check and formatting in ellama-tools.el
The commit fixes a bug in the directory tree function where a string was
returned instead of a formatted string. Additionally, it improves the
formatting
of the tool definition for the "today" function by properly aligning the
arguments in the llm-make-tool call.
---
ellama-tools.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/ellama-tools.el b/ellama-tools.el
index 9fedec53b9..ae676e44db 100644
--- a/ellama-tools.el
+++ b/ellama-tools.el
@@ -243,7 +243,7 @@ otherwise."
"Return a string representing the directory tree under DIR.
DEPTH is the current recursion depth, used internally."
(if (not (file-exists-p dir))
- ("Directory %s doesn't exists" dir)
+ (format "Directory %s doesn't exists" dir)
(let ((indent (make-string (* (or depth 0) 2) ? ))
(tree ""))
(dolist (f (sort (cl-remove-if
@@ -497,15 +497,15 @@ Replace OLDCONTENT with NEWCONTENT."
'ellama-tools--today))
(add-to-list
-'ellama-tools-available
-(llm-make-tool :function
- 'ellama-tools-today
- :name
- "today"
- :args
- nil
- :description
- "Return current date."))
+ 'ellama-tools-available
+ (llm-make-tool :function
+ 'ellama-tools-today
+ :name
+ "today"
+ :args
+ nil
+ :description
+ "Return current date."))
(defun ellama-tools--now ()
"Return current date, time and timezone."