gptel: Fix spacing issues in response
This commit is contained in:
parent
86bf0c9f74
commit
a5fe30312f
1 changed files with 4 additions and 2 deletions
6
gptel.el
6
gptel.el
|
@ -191,8 +191,10 @@ Ask for API-KEY if `gptel-api-key' is unset."
|
|||
(if-let* ((status (buffer-substring (line-beginning-position) (line-end-position)))
|
||||
((string-match "200 OK" status))
|
||||
(response (progn (forward-paragraph)
|
||||
(json-read))))
|
||||
(map-nested-elt response '(:choices 0 :message :content))
|
||||
(json-read)))
|
||||
(content (map-nested-elt
|
||||
response '(:choices 0 :message :content))))
|
||||
(string-trim content)
|
||||
(user-error "Chat failed with status: %S" status)))))
|
||||
|
||||
(defvar gptel-playback-response t)
|
||||
|
|
Loading…
Add table
Reference in a new issue