branch: elpa/gptel
commit 8d258486b672ba5d0a8b4dd166cc411241c5c07d
Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>

    gptel-anthropic: Remove auto-cache when sending media
    
    * gptel-anthropic.el (gptel--anthropic-parse-multipart): Don't
    impose caching automatically when including media in Anthropic-API
    requests.  Now that `gptel-cache' is available, it is left up to
    the user to turn on caching for Anthropic models if they wish to.
    
    Caching unconditionally here also leads to errors: when you add a
    cache point to the system prompt, messages array, tools AND after
    this image, the API complains that there are too many cache
    markers.
---
 gptel-anthropic.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gptel-anthropic.el b/gptel-anthropic.el
index 157173519fa..79ca0132cec 100644
--- a/gptel-anthropic.el
+++ b/gptel-anthropic.el
@@ -470,10 +470,7 @@ format."
    `(:type ,type
      :source (:type "base64"
               :media_type ,(plist-get part :mime)
-              :data ,(gptel--base64-encode media))
-     ;; TODO Make media caching a user option
-     ,@(and (gptel--model-capable-p 'cache)
-        '(:cache_control (:type "ephemeral"))))
+              :data ,(gptel--base64-encode media)))
    into parts-array
    else if (plist-get part :textfile) collect
    `(:type "text"

Reply via email to