gptel: Use :require for auth-source-search (#78)
gptel.el (gptel-api-key-from-auth-source): To read from .authinfo.gpg the key parameter :require for auth-source-search is needed.
This commit is contained in:
parent
a7207a3835
commit
e6df1a5e33
1 changed files with 2 additions and 1 deletions
3
gptel.el
3
gptel.el
|
@ -229,7 +229,8 @@ To set the temperature for a chat session interactively call
|
||||||
By default, `gptel-host' is used as HOST and \"apikey\" as USER."
|
By default, `gptel-host' is used as HOST and \"apikey\" as USER."
|
||||||
(if-let ((secret (plist-get (car (auth-source-search
|
(if-let ((secret (plist-get (car (auth-source-search
|
||||||
:host (or host gptel-host)
|
:host (or host gptel-host)
|
||||||
:user (or user "apikey")))
|
:user (or user "apikey")
|
||||||
|
:require '(:secret)))
|
||||||
:secret)))
|
:secret)))
|
||||||
(if (functionp secret)
|
(if (functionp secret)
|
||||||
(encode-coding-string (funcall secret) 'utf-8)
|
(encode-coding-string (funcall secret) 'utf-8)
|
||||||
|
|
Loading…
Add table
Reference in a new issue