mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-13 18:20:56 -07:00
fix(llm): gptel-magit: non-string responses
Resolves an upstream issue (ragnard/gptel-magit#9) where gptel-magit requests may return a non-string response, causing a type error. The solution was adapted from an upstream PR (ragnard/gptel-magit#4). Ref: ragnard/gptel-magit#9 Ref: ragnard/gptel-magit#4
This commit is contained in:
parent
0ec6255f23
commit
b30f5ca6df
1 changed files with 14 additions and 1 deletions
|
|
@ -39,7 +39,20 @@
|
|||
(if (eq gptel-magit-backend gptel--openrouter)
|
||||
'(:reasoning (:exclude t :effort "minimal"))
|
||||
nil)))
|
||||
(apply fn args))))
|
||||
(apply fn args)))
|
||||
|
||||
;; HACK: Responses from the system/API calls might not be a string, causing
|
||||
;; type errors.
|
||||
;; REVIEW: Remove these when ragnard/gptel-magit#9 is resolved OR
|
||||
;; ragnard/gptel-magit#4 is merged.
|
||||
(defadvice! +llm--fix-gptel-magit--non-string-responses-a (plist)
|
||||
:filter-args #'gptel-magit--request
|
||||
(when-let* ((callback (plist-get plist :callback)))
|
||||
(cl-callf plist-put plist :callback
|
||||
(lambda (response info)
|
||||
(when (stringp response)
|
||||
(funcall callback response info)))))
|
||||
plist))
|
||||
|
||||
|
||||
(use-package! ob-gptel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue