Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gptel: Allow setting custom curl path #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gptel-curl.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ the response is inserted into the current buffer after point."
(args (gptel-curl--get-args (plist-get info :prompt) token))
(stream (and gptel-stream (gptel-backend-stream gptel-backend)))
(process (apply #'start-process "gptel-curl"
(generate-new-buffer "*gptel-curl*") "curl" args)))
(generate-new-buffer "*gptel-curl*") gptel-curl-path args)))
(when (eq gptel-log-level 'debug)
(gptel--log (json-encode (cons "curl" args))
(gptel--log (json-encode (cons gptel-curl-path args))
"request Curl command"))
(with-current-buffer (process-buffer process)
(set-process-query-on-exit-flag process nil)
Expand Down
7 changes: 6 additions & 1 deletion gptel.el
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ all at once. This wait is asynchronous.
:type 'boolean)
(make-obsolete-variable 'gptel-playback 'gptel-stream "0.3.0")

(defcustom gptel-use-curl (and (executable-find "curl") t)
(defcustom gptel-curl-path "curl"
"The path to the curl executable."
:group 'gptel
:type 'string)

(defcustom gptel-use-curl (and (executable-find gptel-curl-path) t)
"Whether gptel should prefer Curl when available."
:group 'gptel
:type 'boolean)
Expand Down