branch: elpa/gptel
commit 2270c99a9b361c90c8b2d6a49160aaa228eb2b7e
Author: Karthik Chikmagalur <[email protected]>
Commit: Karthik Chikmagalur <[email protected]>

    gptel: Improve error message for missing tool in preset
    
    * gptel.el (gptel--apply-preset): When a tool spec in a preset
    cannot be applied, possibly because some tools are not available,
    explain which tools failed to be added instead of listing the full
    list of tools.
---
 gptel.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gptel.el b/gptel.el
index 8b207af790a..21f67118a9d 100644
--- a/gptel.el
+++ b/gptel.el
@@ -2130,7 +2130,8 @@ example) apply the preset buffer-locally."
                                        (string (ignore-errors
                                                  (gptel-get-tool tool-name))))
                           do (unless tool
-                               (user-error "gptel preset: Cannot find tool %s" 
val))
+                               (user-error "gptel preset: Cannot find tool %S"
+                                           tool-name))
                           collect tool))))
           (funcall setter 'gptel-tools (cl-delete-duplicates tools :test 
#'eq))))
        ((and (let sym (or (intern-soft

Reply via email to