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

    gptel: Change gptel-tool include slot default
    
    * gptel-request.el (gptel-tool): Change the default value of a
    gptel-tool's :include slot, since including tool results in the
    buffer is required for coherent multi-turn conversations. (#1326)
    
    * NEWS (Breaking changes): Mention change and reason.
---
 NEWS             | 11 +++++++++++
 gptel-request.el |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index bb35214392..b926e94b14 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,17 @@
   response on new conversation turns is not recommeded by LLM APIs.
   Reasoning text can also fill up the context window.
 
+- ~gptel-make-tool~ now sets the tool's =:include= slot by default.
+  This means that unless =:include nil= is explicitly specified,
+  gptel-tools will default to including their results in the buffer when
+  using ~gptel-send~.  This is recommended for coherent multi-turn
+  conversations involving tool use, as the LLM uses tool results from
+  past turns for context.
+
+  (Tool result inclusion can be controlled globally (or buffer-locally)
+  for all tools via ~gptel-include-tool-results~, whose default value
+  has not been altered.)
+
 - The models =gpt-41-copilot=, =gpt-5= and =claude-opus-41= have been
   removed from the default list of GitHub Copilot models.  These models
   are no longer available in the GitHub Copilot API.
diff --git a/gptel-request.el b/gptel-request.el
index fd155c11d6..2f6230a32e 100644
--- a/gptel-request.el
+++ b/gptel-request.el
@@ -1395,7 +1395,7 @@ feed the LLM the results.  You can add tools via
   (async nil :type boolean :documentation "Whether the function runs 
asynchronously")
   (category nil :type string :documentation "Use to group tools by purpose")
   (confirm nil :type boolean :documentation "Seek confirmation before running 
tool?")
-  (include nil :type boolean :documentation "Include tool results in buffer?"))
+  (include t :type boolean :documentation "Include tool results in buffer?"))
 
 (defun gptel--preprocess-tool-args (spec)
   "Convert symbol :type values in tool SPEC to strings destructively."

Reply via email to