Closed AnselmC closed 3 weeks ago
These are great ideas! Please make a PR.
(Could even generate the buffer name using a language model but maybe that's too fancy.)
Cool, I did that. Good idea around generating buffer name, I'll create a separate PR for that though
Hey, thanks for this package! I've been using it more extensively recently and was wondering what your opinion of these two features is and whether or not I should create a PR.
Derive from markdown mode if available since the streamed output is formatted as markdown. Something like
(I haven't yet figured out how to make it only derive from markdown mode conditionally, i.e. when the user has it installed) But this results in very nicely parseable output:
Use named buffer I find it useful to have multiple ongoing 'conversation' threads with gpt. However, the temporary buffers don't allow me to search for them in the buffer list and I often accidentally close them. I've been using something like the following to have named buffers that I can search and switch to. What do you think about this?
(defun gpt-create-output-buffer (command n) "Create or get a named buffer to capture the output of the GPT process. The buffer name is derived from the first N characters of COMMAND. Use the `gpt-mode' for the output buffer." (let ((buffer-name (concat "gpt" "[" (number-to-string gpt-buffer-counter) "]:" (substring command 0 (min n (length command))) "..." "*")) (output-buffer (get-buffer-create buffer-name))) (setq gpt-buffer-counter (1+ gpt-buffer-counter)) ; Increment the counter (with-current-buffer output-buffer (gpt-mode)) output-buffer))