branch: elpa/gptel
commit 45814df5dca127cc2b0ec6d4e3daa1b7e57d8a5b
Author: kiennq <kien.n.qu...@gmail.com>
Commit: GitHub <nore...@github.com>

    gptel-gh: Send vision-request header only when tracking media (#878)
    
    gptel-gh (gptel-make-gh-copilot): Only send the header requesting
    vision support when the model supports it and it is explicitly
    requested (via `gptel-track-media').
---
 gptel-gh.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gptel-gh.el b/gptel-gh.el
index 5b8527b934..5caef32a74 100644
--- a/gptel-gh.el
+++ b/gptel-gh.el
@@ -289,7 +289,9 @@ Then we need a session token."
                       ("x-request-id" . ,(gptel--gh-uuid))
                       ("vscode-sessionid" . ,(or (gptel--gh-sessionid 
gptel-backend) ""))
                       ("vscode-machineid" . ,(or (gptel--gh-machineid 
gptel-backend) ""))
-                      ("copilot-vision-request" . "true")
+                      ,@(when (and gptel-track-media
+                                   (gptel--model-capable-p 'media))
+                          `(("copilot-vision-request" . "true")))
                       ("copilot-integration-id" . "vscode-chat"))))
           (host "api.githubcopilot.com")
           (protocol "https")

Reply via email to