gptel: Rename internal functions

gptel.el (gptel-parse-response, gptel-get-response): These functions
have been renamed to mark them for internal use.
This commit is contained in:
Karthik Chikmagalur 2023-03-08 00:56:32 -08:00
parent 88995a6436
commit 03113afd50

View file

@ -117,7 +117,7 @@ When set to nil, it is inserted all at once.
(response (aio-await (response (aio-await
(funcall (funcall
(if (and gptel-use-curl (require 'gptel-curl nil t)) (if (and gptel-use-curl (require 'gptel-curl nil t))
#'gptel--curl-get-response #'gptel-get-response) #'gptel--curl-get-response #'gptel--get-response)
full-prompt))) full-prompt)))
(content-str (plist-get response :content)) (content-str (plist-get response :content))
(status-str (plist-get response :status))) (status-str (plist-get response :status)))
@ -143,7 +143,7 @@ When set to nil, it is inserted all at once.
(propertize (format " Response Error: %s" status-str) (propertize (format " Response Error: %s" status-str)
'face 'error))))) 'face 'error)))))
(aio-defun gptel-get-response (prompts) (aio-defun gptel--get-response (prompts)
"Fetch response for PROMPTS from ChatGPT. "Fetch response for PROMPTS from ChatGPT.
Return the message received." Return the message received."
@ -169,10 +169,10 @@ Return the message received."
(aio-await (aio-await
(aio-url-retrieve "https://api.openai.com/v1/chat/completions")))) (aio-url-retrieve "https://api.openai.com/v1/chat/completions"))))
(prog1 (prog1
(gptel-parse-response response-buffer) (gptel--parse-response response-buffer)
(kill-buffer response-buffer))))) (kill-buffer response-buffer)))))
(defun gptel-parse-response (response-buffer) (defun gptel--parse-response (response-buffer)
"Parse response in RESPONSE-BUFFER." "Parse response in RESPONSE-BUFFER."
(when (buffer-live-p response-buffer) (when (buffer-live-p response-buffer)
(with-current-buffer response-buffer (with-current-buffer response-buffer