Make it possible to specify input/output in presets
Thanks for the amazing package, I use it daily.
Context
I use many models, and presets become an important part of my workflow. I use presents to both quicly change models/model paremeters when working in a random buffer, and also chatting in gptel buffers.
One thing that I sometimes want is to ask a quick question about the buffer up to a point, or a region, using a more expensive model.
I do have presets for this case (@expensive-explain, @expensive-suggest, etc). Now, in my *-explain presets I also want to output the response into the echo-area, or a popwin, or a buffer, depending on circumstances. Being able to choose a different input source can also be useful.
Presents sound like they should do this. But after looking into relevant code I realized that presets mostly configure model parameters.
Solution
I'd like to be able to define input sources (minibuffer, kill-ring, custom source) and output targets (echo area, buffer, gptel session, kill-ring) in presets, similar to what is possible to do using gptel-menu.
This would make it possible to specify precisely what I want from a particular preset ("generate a function using an expensive model and append it to the kill ring), thus making presets much more general.
Perfect solution
The most general solution would be to make it possible to configure all of the gptel menu's options through presets: input, output, additional context, ...
So instead of going through the menu (which is great for discoverability but also ties configuration to the menu) I would then work with my presets only, without any custom code or patches.
https://github.com/karthink/gptel/pull/992 can help with the input. Similar to what I have in https://github.com/karthink/gptel/issues/905#issuecomment-3010807805, you could get the input from elsewhere inside one of prompt-transform-functions.
+1.
I'm trying to define an eshell preset to automate:
- adding my whole
eshellbuffer in the system prompt, so it has the context of what I'm trying to do plus my question/instruction - appending a prompt instructing it to always return valid "
eshellcode" - puts the LLM response in-place so I can just press enter to run it
1 and 2 seems doable through the :system property, but 3 seems not to be?
It seems that the gptel-request takes in-place as an argument, would it be possible to have a gptel-in-place variable, and then have the transient suffix (or infix?) track that variable?
EDIT: https://github.com/nvimtor/gptel/commit/c1843de620d34ae7a8f1b38b4173345ec9af9d52 works well enough for me