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

    gptel: Decouple gptel-track-media from gptel-context
    
    * gptel-request.el (gptel--realize-query): Decouple
    `gptel-track-media' behavior from media files added to the context
    via `gptel-add-file'.  `gptel-track-media' is intended to only be
    relevant to chat buffers, like `gptel-track-response'.  Media
    files added explicitly to the context should always be sent.
    
    * NEWS: Mention change.
---
 NEWS             | 6 ++++++
 gptel-request.el | 3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 78df4b186f4..afb844f5e3f 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,12 @@
 
 ** Breaking changes
 
+- =gptel-track-media= now controls whether links to media files are
+  tracked /only/ in chat buffers.  Previously it also controlled
+  whether media files added to the context explicitly via
+  =gptel-add-file= were sent.  This is considered a bug and has now
+  been fixed.
+
 ** New models and backends
 
 ** New features and UI changes
diff --git a/gptel-request.el b/gptel-request.el
index 03ae103a97c..680b74ccd3f 100644
--- a/gptel-request.el
+++ b/gptel-request.el
@@ -2088,8 +2088,7 @@ Initiate the request when done."
         ;; irrespective of the preference in `gptel-use-context'.  This is
         ;; because media cannot be included (in general) with system messages.
         ;; TODO(augment): Find a way to do this in the prompt-buffer?
-        (when (and gptel-context gptel-use-context
-                   gptel-track-media (gptel--model-capable-p 'media))
+        (when (and gptel-context gptel-use-context (gptel--model-capable-p 
'media))
           (gptel--inject-media gptel-backend full-prompt))
         (unless stream (cl-remf info :stream))
         (plist-put info :backend gptel-backend)

Reply via email to