Closed Ypot closed 11 months ago
It looks like this will take a bit of code to do. I'll see about adding a hook or some other mechanism for this.
maybe naive but am curious how is this useful @Ypot very simple to copy the current header to the kill ring but what's a use case for copying the whole content?
maybe naive but am curious how is this useful @Ypot very simple to copy the current header to the kill ring but what's a use case for copying the whole content?
For example to see how act on the same prompt other LLMs.
I thought this would be very easy...
ah interesting, isn't the full payload with prompt a dict that's API specific though? do other LLMs generally accept similar enough payload? what would you imagine the kill ring content look like e.g.
Is it possible to save the prompts we send, directive included, in the kill ring? In that way, we could use them in other places.
This is now possible. Here is a function that does it:
(defun gptel-copy-prompts-as-kill ()
(interactive)
(when-let*
((bounds (gptel--get-bounds))
(prompts
(cl-loop for (beg . end) in bounds
with prev-beg
collect (buffer-substring-no-properties (or prev-beg (point-min)) beg)
into prompts
do (setq prev-beg end)
finally return
(nconc (list gptel--system-message)
prompts (list (buffer-substring-no-properties end (point-max)))))))
(kill-new (apply #'concat prompts))))
(You can modify this command to change how the prompts are returned, for instance as a list of strings instead of one string.)
Is it possible to save the prompts we send, directive included, in the kill ring? In that way, we could use them in other places.
Thanks for your exciting package!