emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gptel 5c3b26aeec 138/273: gptel-curl: Tweak Curl arguments


From: ELPA Syncer
Subject: [nongnu] elpa/gptel 5c3b26aeec 138/273: gptel-curl: Tweak Curl arguments for windows
Date: Wed, 1 May 2024 10:02:15 -0400 (EDT)

branch: elpa/gptel
commit 5c3b26aeece94c65ac605613c502767cc97478a5
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>

    gptel-curl: Tweak Curl arguments for windows
    
    gptel-curl.el (gptel-curl--common-args, gptel-curl--get-args):
    Don't use compression with Curl on Windows, since it seems to
    be generally not supported. Fix #90.
---
 gptel-curl.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/gptel-curl.el b/gptel-curl.el
index dc0b1f3599..8f5e070b80 100644
--- a/gptel-curl.el
+++ b/gptel-curl.el
@@ -34,6 +34,14 @@
 (require 'map)
 (require 'json)
 
+(defconst gptel-curl--common-args
+  (if (memq system-type '(windows-nt ms-dos))
+      '("--disable" "--location" "--silent" "-XPOST"
+        "-m300" "-D-")
+    '("--disable" "--location" "--silent" "--compressed"
+      "-XPOST" "-m300" "-D-"))
+  "Arguments always passed to Curl for gptel queries.")
+
 (defvar gptel-curl--process-alist nil
   "Alist of active GPTel curl requests.")
 
@@ -52,11 +60,8 @@ PROMPTS is the data to send, TOKEN is a unique identifier."
                         (funcall backend-header)
                       backend-header)))))
     (append
-     (list "--location" "--silent" "--compressed" "--disable"
-           (format "-X%s" "POST")
-           (format "-w(%s . %%{size_header})" token)
-           (format "-m%s" 300)
-           "-D-"
+     gptel-curl--common-args
+     (list (format "-w(%s . %%{size_header})" token)
            (format "-d%s" data))
      (when (not (string-empty-p gptel-proxy))
        (list "--proxy" gptel-proxy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]