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

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

[elpa] externals/llm 9a9b0de0df 52/71: Add llm-request-plz-connect-timeo


From: ELPA Syncer
Subject: [elpa] externals/llm 9a9b0de0df 52/71: Add llm-request-plz-connect-timeout
Date: Fri, 17 May 2024 00:58:48 -0400 (EDT)

branch: externals/llm
commit 9a9b0de0df67a68456e57b62d37d27ec67af91e4
Author: Roman Scherer <roman@burningswell.com>
Commit: Roman Scherer <roman@burningswell.com>

    Add llm-request-plz-connect-timeout
---
 llm-request-plz.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/llm-request-plz.el b/llm-request-plz.el
index 8d7b9a94cd..2a3665eb2b 100644
--- a/llm-request-plz.el
+++ b/llm-request-plz.el
@@ -39,6 +39,11 @@ not very long so that we can end stuck requests."
   :type 'integer
   :group 'llm)
 
+(defcustom llm-request-plz-connect-timeout 10
+  "The number of seconds to wait for a connection to a HTTP server."
+  :type 'integer
+  :group 'llm)
+
 (defun llm-request-success (status)
   "Return non-nil if STATUS is a successful HTTP status code."
   (<= 200 status 299))
@@ -59,6 +64,7 @@ TIMEOUT is the number of seconds to wait for a response."
         :as `(media-types ,plz-media-types)
         :body (when data
                 (encode-coding-string (json-encode data) 'utf-8))
+        :connect-timeout llm-request-plz-connect-timeout
         :headers (append headers '(("Content-Type" . "application/json")))
         :timeout (or timeout llm-request-plz-timeout))))
         (if (llm-request-success (plz-response-status resp))
@@ -141,6 +147,7 @@ only used by other methods in this file."
                          plz-media-types))
     :body (when data
             (encode-coding-string (json-encode data) 'utf-8))
+    :connect-timeout llm-request-plz-connect-timeout
     :headers (append headers
                      '(("Content-Type" . "application/json")))
     :then (lambda (response)



reply via email to

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