branch: elpa/gptel
commit d0c19ba78b0fe531cfab2b6f79a2b35812ae5094
Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>

    gptel: Only preprocess :args of tools spec (#837)
    
    * gptel.el (gptel--make-tool): Only preprocess the :args entry of
    a tool specification plist.  The tool function might be an
    interpreted closures that's represented as a list, and we don't
    want to touch any of that.
---
 gptel.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gptel.el b/gptel.el
index 07872d82c5..9bf53fada2 100644
--- a/gptel.el
+++ b/gptel.el
@@ -1594,7 +1594,8 @@ feed the LLM the results.  You can add tools via
 
 (defun gptel--make-tool (&rest spec)
   "Construct a gptel-tool according to SPEC."
-  (apply #'gptel--make-tool-internal (gptel--preprocess-tool-args spec)))
+  (gptel--preprocess-tool-args (plist-get spec :args))
+  (apply #'gptel--make-tool-internal spec))
 
 (defvar gptel--known-tools nil
   "Alist of gptel tools arranged by category.

Reply via email to