branch: elpa/gptel
commit e0736662389612d779345ae2f45267307d990ebd
Author: Kevin Montag <kmon...@gmail.com>
Commit: GitHub <nore...@github.com>

    gptel: Don't use dynamic value of gptel-use-tools (#755)
    
    gptel.el (gptel--tool-use-p, gptel--tool-result-p): Don't depend
    on the value of `gptel-use-tools` when handling tool states in the
    FSM.  `gptel-use-tools` may be let-bound around a request and be
    nil when these checks are called.  Instead, check for `:tools` in
    the FSM info, as this is always non-nil if the request was
    dispatched with tools.
---
 gptel.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gptel.el b/gptel.el
index 2e3d0ed8b2..1d1b47fbd9 100644
--- a/gptel.el
+++ b/gptel.el
@@ -2132,10 +2132,10 @@ Run post-response hooks."
 (defun gptel--error-p (info) (plist-get info :error))
 
 (defun gptel--tool-use-p (info)
-  (and gptel-use-tools (plist-get info :tool-use)))
+  (and (plist-get info :tools) (plist-get info :tool-use)))
 
 (defun gptel--tool-result-p (info)
-  (and gptel-use-tools (plist-get info :tool-success)))
+  (and (plist-get info :tools) (plist-get info :tool-success)))
 
 
 ;;; Send queries, handle responses

Reply via email to