Function: gptel--update-tool-call

gptel--update-tool-call is a natively compiled function defined in gptel.el.

Signature

(gptel--update-tool-call FSM)

Documentation

Update gptel's status in FSM when calling a tool.

Source Code

;; Defined in /nix/store/q3r7g81pvghw7a523kjk2k2zih3pfk8z-emacs-packages-deps/share/emacs/site-lisp/elpa/gptel-20261002.545/gptel.el
(defun gptel--update-tool-call (fsm)
  "Update gptel's status in FSM when calling a tool."
  (with-current-buffer (plist-get (gptel-fsm-info fsm) :buffer)
    (setq gptel--fsm-last fsm)
    (when gptel-mode
      (if-let* ((info (gptel-fsm-info fsm))
                (names (cl-loop for call in (plist-get info :tool-use)
                                collect (plist-get call :name))))
          (gptel--update-status
           (concat
            (propertize
             (if (length> names 1) " Calling tools (" " Calling tool (")
             'face 'mode-line-emphasis)
            (mapconcat (lambda (name) (propertize name 'face 'font-lock-keyword-face))
                       names (propertize ", " 'face 'mode-line-emphasis))
            (propertize ")" 'face 'mode-line-emphasis)))
        ;; FIXME: Is this branch reachable?
        (gptel--update-status " Calling tool..." 'mode-line-emphasis)))))