[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel bb8b37d8c0 100/273: gptel, gptel-curl: Fix byte-comp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel bb8b37d8c0 100/273: gptel, gptel-curl: Fix byte-compile warnings |
Date: |
Wed, 1 May 2024 10:01:55 -0400 (EDT) |
branch: elpa/gptel
commit bb8b37d8c09ff0ed07d98bf5269fe49229679168
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel, gptel-curl: Fix byte-compile warnings
gptel.el (gptel--request-data): Also use :json-false to encode nil in the
http
request.
---
gptel-curl.el | 16 +++++++---------
gptel.el | 5 +++--
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/gptel-curl.el b/gptel-curl.el
index 0d6733f573..6914c60fac 100644
--- a/gptel-curl.el
+++ b/gptel-curl.el
@@ -124,10 +124,10 @@ the response is inserted into the current buffer after
point."
(message "No gptel request associated with buffer %S" (buffer-name buf))))
;; TODO: Separate user-messaging from this function
-(defun gptel-curl--stream-cleanup (process status)
+(defun gptel-curl--stream-cleanup (process _status)
"Process sentinel for GPTel curl requests.
-PROCESS and STATUS are process parameters."
+PROCESS and _STATUS are process parameters."
(let ((proc-buf (process-buffer process)))
(when gptel--debug
(with-current-buffer proc-buf
@@ -181,8 +181,7 @@ PROCESS and STATUS are process parameters."
INFO is a mutable plist containing information relevant to this buffer.
See `gptel--url-get-response' for details."
- (let ((status-str (plist-get response :status))
- (start-marker (plist-get info :position))
+ (let ((start-marker (plist-get info :position))
(tracking-marker (plist-get info :tracking-marker))
(transformer (plist-get info :transformer)))
(when response
@@ -205,8 +204,7 @@ See `gptel--url-get-response' for details."
(insert response))))))
(defun gptel-curl--stream-filter (process output)
- (let* ((content-strs)
- (proc-info (alist-get process gptel-curl--process-alist)))
+ (let* ((proc-info (alist-get process gptel-curl--process-alist)))
(with-current-buffer (process-buffer process)
;; Insert output
(save-excursion
@@ -248,7 +246,7 @@ See `gptel--url-get-response' for details."
(funcall (or (plist-get proc-info :callback)
#'gptel-curl--stream-insert-response)
(let* ((json-object-type 'plist)
- (response) (content-str))
+ (content-strs))
(condition-case nil
(while (re-search-forward "^data:" nil t)
(save-match-data
@@ -263,10 +261,10 @@ See `gptel--url-get-response' for details."
(apply #'concat (nreverse content-strs)))
proc-info))))))
-(defun gptel-curl--sentinel (process status)
+(defun gptel-curl--sentinel (process _status)
"Process sentinel for GPTel curl requests.
-PROCESS and STATUS are process parameters."
+PROCESS and _STATUS are process parameters."
(let ((proc-buf (process-buffer process)))
(when gptel--debug
(with-current-buffer proc-buf
diff --git a/gptel.el b/gptel.el
index 0406f395af..4ba8dacb55 100644
--- a/gptel.el
+++ b/gptel.el
@@ -67,7 +67,8 @@
(require 'text-property-search)
(defgroup gptel nil
- "Interact with ChatGPT from anywhere in Emacs.")
+ "Interact with ChatGPT from anywhere in Emacs."
+ :group 'hypermedia)
(defcustom gptel-host "api.openai.com"
"The API host queried by gptel."
@@ -517,7 +518,7 @@ there."
(let ((prompts-plist
`(:model ,gptel-model
:messages [,@prompts]
- :stream ,(and gptel-stream gptel-use-curl))))
+ :stream ,(or (and gptel-stream gptel-use-curl) :json-false))))
(when gptel-temperature
(plist-put prompts-plist :temperature (gptel--numberize
gptel-temperature)))
(when gptel-max-tokens
- [nongnu] elpa/gptel d6ef79f621 177/273: gptel-transient: Show descriptions of directives, (continued)
- [nongnu] elpa/gptel d6ef79f621 177/273: gptel-transient: Show descriptions of directives, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 0690c8b6a9 161/273: gptel-transient: Exit transient when writing directive, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 149261ee79 211/273: gptel-transient: Avoid clashes with the custom directive key (#219), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel dd5833eef3 023/273: gptel: Improve gptel-mode setup, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3d0df72bd3 027/273: gptel-transient: linting for MELPA, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 2982ede17d 255/273: gptel-org: Add gptel-org, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9bc54bed9c 244/273: gptel-transient: Remove "-ts" suffix from major mode (#259), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9a5a4a60d5 248/273: README: Mention wiki entry on saving transient flags, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 8dbcbbb908 256/273: gptel-org: Move session save/restore code for Org, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1b47235e25 071/273: README: Add section on gptel-request, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel bb8b37d8c0 100/273: gptel, gptel-curl: Fix byte-compile warnings,
ELPA Syncer <=
- [nongnu] elpa/gptel 219e163dc7 091/273: gptel-curl: Add gptel-abort, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a660e13a8b 106/273: gptel, gptel-transient: Fix read temperature from minibuffer (#85), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c0ffce0849 110/273: gptel: Fix reading bounds in org files (#98), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 648fa228a1 115/273: gptel: Fix check for markdown-mode (#109), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 63027083cd 125/273: README: Update additional customization section, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 57a70c23cb 131/273: gptel: Skip to end of word before sending, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1434bbac7b 122/273: gptel-ollama, gptel-openai: Add example of backend creation, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 8973498378 151/273: gptel: Add minimal status indicator via mode-line-process, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3dd00a7457 145/273: gptel-gemini: Add streaming responses, simplify configuration, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 8d3e08faa8 157/273: gptel: Don't use called-interactively-p, ELPA Syncer, 2024/05/01