branch: externals/ellama
commit 82f22253bced14bcdfc28084ff92f35fbce560bd
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>

    Fix bug when only single tool was available
    
    Change comparison in adding to the list of available tools from `plist-get` 
to
    `llm-tool-name` for duplicates checking. Since in the list was not plists, 
but
    llm-tools we got situation where nil always equal nil, because `plist-get` 
return
    nil for every llm-tool, and all tools we try to add to the list was not 
added as
    duplicates.
---
 ellama-tools.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ellama-tools.el b/ellama-tools.el
index 0868cfb85e..49fffa5487 100644
--- a/ellama-tools.el
+++ b/ellama-tools.el
@@ -243,8 +243,8 @@ TOOL-PLIST is a property list in the format expected by 
`llm-make-tool'."
    'ellama-tools-available
    (apply 'llm-make-tool (ellama-tools-wrap-with-confirm tool-plist))
    nil (lambda (a b)
-         (string= (plist-get a :name)
-                  (plist-get b :name)))))
+         (string= (llm-tool-name a)
+                  (llm-tool-name b)))))
 
 (defun ellama-tools-enable-by-name-tool (name)
   "Add to `ellama-tools-enabled' each tool that matches NAME."

Reply via email to