Function: gptel--inject-tool-call
gptel--inject-tool-call is a byte-compiled function defined in
gptel-request.el.
Signature
(gptel--inject-tool-call BACKEND DATA TOOL-CALL NEW-CALL)
Documentation
Replace TOOL-CALL in query DATA with NEW-CALL.
DATA is the request payload containing the array of user and assistant messages, typically available as (plist-get INFO :data). TOOL-CALL is the call plist as recorded by gptel's response parser(s). NEW-CALL is the replacement plist containing the new tool name and arguments, in the form
(:name "newName" :args (:arg1 "newArg" :arg2 ...))
:name and :args are both optional.
If NEW-CALL is nil, the tool call is removed from DATA and thus the turn history.
BACKEND is the gptel-backend.
Implementations
(gptel--inject-tool-call BACKEND DATA TOOL-CALL NEW-CALL) in `gptel-request.el'.
Undocumented
Source Code
;; Defined in /nix/store/q3r7g81pvghw7a523kjk2k2zih3pfk8z-emacs-packages-deps/share/emacs/site-lisp/elpa/gptel-20261002.545/gptel-request.el
(cl-defgeneric gptel--inject-tool-call (backend _data _tool-call new-call)
"Replace TOOL-CALL in query DATA with NEW-CALL.
DATA is the request payload containing the array of user and assistant
messages, typically available as (plist-get INFO :data). TOOL-CALL is
the call plist as recorded by gptel's response parser(s). NEW-CALL is
the replacement plist containing the new tool name and arguments, in the
form
(:name \"newName\" :args (:arg1 \"newArg\" :arg2 ...))
:name and :args are both optional.
If NEW-CALL is nil, the tool call is removed from DATA and thus the turn
history.
BACKEND is the `gptel-backend'."
(display-warning
'(gptel tool-call)
(format "Editing tool call arguments is not implemented for %s.\
Ignoring new arguments %s"
(type-of backend)
(truncate-string-to-width (prin1-to-string new-call) 50 nil nil t))))