branch: externals/ellama
commit b5459e1cfdae4cdb0b00f8784c1d73687c0900ae
Merge: 501ca4bf1f e5c63e8ff8
Author: Sergey Kostyaev <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #380 from s-kostyaev/fix-tools-doubling
    
    Prevent duplicate tools in ellama-tools
---
 NEWS.org                  |  9 +++++++++
 ellama-tools.el           |  5 ++++-
 ellama.el                 |  2 +-
 skills/changelog/SKILL.md | 12 ++++++------
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index b848919a7c..793ce967d4 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,12 @@
+* Version 1.12.5
+- Prevent duplicate tools in ellama-tools. Added a test function to add-to-list
+  to check if a tool with the same name already exists before adding it to
+  ellama-tools-available. This prevents duplicate tools from being registered
+  when enabling tools by name.
+- Update changelog skill quoting style. Changed the changelog generation skill
+  to use org-mode quoting (~text~) instead of markdown backticks (`text`). Also
+  use "MUST" instead of "must" to pay LLM's attention to the newline
+  requirement.
 * Version 1.12.4
 - Normalize file path in write-file function. Added expand-file-name to 
properly
   handle both absolute and relative paths when writing files, preventing
diff --git a/ellama-tools.el b/ellama-tools.el
index eec9a0b952..54ab31c65d 100644
--- a/ellama-tools.el
+++ b/ellama-tools.el
@@ -241,7 +241,10 @@ Returns a new tool definition with the :function wrapped."
 TOOL-PLIST is a property list in the format expected by `llm-make-tool'."
   (add-to-list
    'ellama-tools-available
-   (apply 'llm-make-tool (ellama-tools-wrap-with-confirm tool-plist))))
+   (apply 'llm-make-tool (ellama-tools-wrap-with-confirm tool-plist))
+   nil (lambda (a b)
+         (string= (plist-get a :name)
+                  (plist-get b :name)))))
 
 (defun ellama-tools-enable-by-name-tool (name)
   "Add to `ellama-tools-enabled' each tool that matches NAME."
diff --git a/ellama.el b/ellama.el
index 4e54761fe2..aeefee9744 100644
--- a/ellama.el
+++ b/ellama.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/s-kostyaev/ellama
 ;; Keywords: help local tools
 ;; Package-Requires: ((emacs "28.1") (llm "0.24.0") (plz "0.8") (transient 
"0.7") (compat "29.1") (yaml "1.2.3"))
-;; Version: 1.12.4
+;; Version: 1.12.5
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;; Created: 8th Oct 2023
 
diff --git a/skills/changelog/SKILL.md b/skills/changelog/SKILL.md
index 9c3bbbf087..3bd4e4215b 100644
--- a/skills/changelog/SKILL.md
+++ b/skills/changelog/SKILL.md
@@ -6,11 +6,11 @@ description: Use this skill to generate changelog.
 # Generating changelog
 
 Call shell_command tool with "git log --reverse main..HEAD" argument. Based on
-the output write short changelog in org-mode list format. Use "~tildas~" 
quoting
-instead of "`backticks`" quoting. Do not add any anknowledgements. Every
-changelog element should be ended with full stop. Changelog shouldn't be too
-short or too long, use detailed description for major changes and concise
-description for minor changes.
+the output write changelog in org-mode list format. Use org quoting
+(~quoted-text~) instead of markdown quoting (`quoted-text`). Every changelog
+element should be ended with full stop. Changelog shouldn't be too short or too
+long, use detailed description for major changes and concise description for
+minor changes.
 
 Call shell_command tools with "git tag -l --points-at=main" argument to see
 previously released version. Based on this information and minority/majority of
@@ -22,7 +22,7 @@ with header:
 
 * Version {version}
 
-After header should be changelog content. Content must ends with single
+After header should be changelog content. Content MUST ends with single
 newline.
 Example:
  ```text

Reply via email to