ahyatt / llm

A package abstracting llm capabilities for emacs.
GNU General Public License v3.0
204 stars 27 forks source link

Functions as :key values #110

Closed minad closed 14 hours ago

minad commented 5 days ago

Hi!

Would it be possible to support functions as :key values? Functions are commonly used by the auth-source library in Emacs to slightly obfuscate secrets in the Emacs heap.

Right now I have to use funcall to unpack the secret:

(make-llm-openai-compatible
 :key (funcall (plist-get (car (auth-source-search :host "host" :user "apikey")) :secret))
 ...)

This would be better:

(make-llm-openai-compatible
 :key (plist-get (car (auth-source-search :host "host" :user "apikey")) :secret)
 ...)
ahyatt commented 4 days ago

This is a good idea, thanks for thinking of it and sending a PR!