gptel-curl: Replace Curl timeout with speed-time

* gptel-curl.el (gptel-curl--common-args): Following the
discussion in #143, Use "-y300 -Y1" as Curl arguments instead of
specifying the timeout.  Now the connection stays open unless less
than 1 byte of information is exchanged over 300 seconds.
This commit is contained in:
Karthik Chikmagalur 2023-12-20 15:25:59 -08:00
parent 38095eaed5
commit ddd69cbbcf

View file

@ -37,9 +37,9 @@
(defconst gptel-curl--common-args (defconst gptel-curl--common-args
(if (memq system-type '(windows-nt ms-dos)) (if (memq system-type '(windows-nt ms-dos))
'("--disable" "--location" "--silent" "-XPOST" '("--disable" "--location" "--silent" "-XPOST"
"-m300" "-D-") "-y300" "-Y1" "-D-")
'("--disable" "--location" "--silent" "--compressed" '("--disable" "--location" "--silent" "--compressed"
"-XPOST" "-m300" "-D-")) "-XPOST" "-y300" "-Y1" "-D-"))
"Arguments always passed to Curl for gptel queries.") "Arguments always passed to Curl for gptel queries.")
(defvar gptel-curl--process-alist nil (defvar gptel-curl--process-alist nil