gptel-curl: Fix current-buffer for Curl requests
* gptel-curl.el (gptel-curl-get-response): Set buffer-local model parameters in the correct (i.e. gptel) buffer, not in Curl's process buffer. This fixes #43.
This commit is contained in:
parent
f218388d4d
commit
444a43134f
1 changed files with 7 additions and 7 deletions
|
@ -72,13 +72,13 @@ INFO is a plist with the following keys:
|
||||||
|
|
||||||
Call CALLBACK with the response and INFO afterwards. If omitted
|
Call CALLBACK with the response and INFO afterwards. If omitted
|
||||||
the response is inserted into the current buffer after point."
|
the response is inserted into the current buffer after point."
|
||||||
(with-current-buffer (generate-new-buffer "*gptel-curl*")
|
(let* ((token (md5 (format "%s%s%s%s"
|
||||||
(let* ((token (md5 (format "%s%s%s%s"
|
(random) (emacs-pid) (user-full-name)
|
||||||
(random) (emacs-pid) (user-full-name)
|
(recent-keys))))
|
||||||
(recent-keys))))
|
(args (gptel-curl--get-args (plist-get info :prompt) token))
|
||||||
(args (gptel-curl--get-args (plist-get info :prompt) token))
|
(process (apply #'start-process "gptel-curl"
|
||||||
(process (apply #'start-process "gptel-curl" (current-buffer)
|
(generate-new-buffer "*gptel-curl*") "curl" args)))
|
||||||
"curl" args)))
|
(with-current-buffer (process-buffer process)
|
||||||
(set-process-query-on-exit-flag process nil)
|
(set-process-query-on-exit-flag process nil)
|
||||||
(setf (alist-get process gptel-curl--process-alist)
|
(setf (alist-get process gptel-curl--process-alist)
|
||||||
(nconc (list :token token
|
(nconc (list :token token
|
||||||
|
|
Loading…
Add table
Reference in a new issue