Closed phuhl closed 1 year ago
Yes, I have the same problem.
Thanks, I'm able to reproduce it using package-install
. It's very strange indeed. It works after gptel-transient
is loaded, but not otherwise even if gptel-system-prompt
is autoloaded.
This looks like a quirk of how Transient works. I'll ask Tarsius (author of Transient) what's happening here.
In the meantime, you can get it to work by adding (require 'gptel-transient)
in the config section of your use-package block.
Thanks for the quick response!
In the meantime, you can get it to work by adding (require 'gptel-transient) in the config section of your use-package block.
This does not seem to fix the issue for me. The error remains the same. This is my updated use-package call:
(use-package gptel
:ensure t
:config
+ (require 'gptel-transient)
(setq gptel-api-key #'(lambda nil
(plist-get
(nth 0
(auth-source-search :Title "Chat GPT"))
:API\ Key))))
I am also having the same issue, and adding the require
didn't fix things for me:(
I just pushed a fix. Once there's a new release of transient, dynamically generated menus can be supported and the whole custom prompts system should work much better.
Could someone check if the error is still thrown?
Works for me now, thx
@karthink looks like there was a new release of transient 6 days ago. Can we refactor this now?
Also, I think it would be nice if the transient automatically used everything that is defined in gptel-directives instead of just a fixed setup.
Also, I think it would be nice if the transient automatically used everything that is defined in gptel-directives instead of just a fixed setup.
The code for this is already in the file, it's just commented out: https://github.com/karthink/gptel/blob/master/gptel-transient.el#L174
Now that Transient 4.0 is out, this code can replace the current version of gptel-system-prompt
at https://github.com/karthink/gptel/blob/master/gptel-transient.el#L126.
If you're up to testing it a PR would be welcome! It will be a few days before I can get to it myself, unfortunately.
I've pushed a fix in 706ad703. Please test. To make sure the dynamic menus are generated correclty, it will help further to test with a list of directives with overlapping names, such as
(setq gptel-directives
'((programming . "You are a large language model and a careful programmer. Provide code and only code as output without any additional text, prompt or note.")
(prose . "You are a large language model and a writing assistant. Respond concisely.")
(default-chat . "You are a large language model and a conversation partner. Respond concisely.")
(default . "You are a large language model living in Emacs and a helpful assistant. Respond concisely.")))
I'm assuming this now works as intended with the new transient version. Please re-open if this is not the case.
Sorry, forgot to answer. Yes, seems to work, thank you!
Hi, great package.
I have this issue that when running
M-x gptel-menu h
the following error is thrown and no menu is shown:I installed from MELPA: Version: 20230413.602 Commit: a5be53d5e3733ed48023e4862b59ac12fa98be07
I call gptel-menu from a normal markdown-buffer.
Wired thing though is, that when I install gptel freshly via
list-packages
it works. Only when I restart emacs and load gptel via require or use-package it does not work.Here is my use-package code:
Similar to https://github.com/karthink/gptel/issues/27 ?