Closed Ypot closed 9 months ago
Or maybe using inline tasks. It is needed to eval first: (require 'org-inlinetask). Then:
*** My headline.
Body of the headline
The question (the sent text) would be here.
(And the answer would be as follows):
*************** COMMENT [LLM]. ([year]). /[Response's first words]/. In ([GPTEL TOPIC] or [My headline])
:PROPERTIES:
:GPTEL_MODEL: gpt-3.5-turbo
:GPTEL_TOPIC:
:GPTEL_SYSTEM:
:END:
CHATGPT response here
*************** END
Here could continue the body of the headline
...
To avoid the response to be mixed with the original text, I would add an option to "Response to:"
Maybe one of these Response to: -b block (-b) -q quote (-q)
So the response is separated from the previous and next text. Example:
I don't understand your example. You want ChatGPT's response to be enclosed inside (say) quotes, so that the interaction looks like the following:
*** My question here
#+begin_quote
ChatGPT's response here.
#+end_quote
*** My next question here.
#+begin_quote
ChatGPT's response here.
#+end_quote
Is this correct?
Yes, and with automatic signature.
I am thinking in the case where there is not a dedicated buffer for chatgpt, but you are working inside an already existing buffer, where responses mix with your already existing text.
But I think I like better using inlinetasks. There, PROPERTIES could offer information about chatgpt version and its configuration. And, if "commented", they are not exported.
*** My headline.
Body of the headline
My question here
*************** COMMENT OpenAI. (2023). /ChatGPT: Response's first words/ (Ago 20 version). In ("GPTEL TOPIC" or "My headline")
:PROPERTIES:
:GPTEL_MODEL: gpt-3.5-turbo
:GPTEL_TOPIC:
:GPTEL_SYSTEM:
:END:
CHATGPT response here
*************** END
Continues the body of the headline
...
If quotes:
*** My headline.
Text here.
My question here
#+begin_quote
ChatGPT's response here.
-- (ChatGPT 3.5 Turbo, 2023-08-19)
#+end_quote
More text here
My next question here
...
@Ypot This is now possible via #142, at least when gptel-mode is turned on. See the documentation for the variables gptel-prompt-prefix-alist
and gptel-response-prefix-alist
.
Thanks. I don't know how to, but I am closing this issue as I believe it is possible. Bests!
Thanks. I don't know how to, but I am closing this issue as I believe it is possible.
*** My headline.
Text here.
My question here
#+begin_quote
ChatGPT's response here.
-- (ChatGPT 3.5 Turbo, 2023-08-19)
#+end_quote
More text here
My next question here
...
To reproduce this format in org-mode, for example,
;; Place ChatGPT response between quotes
(setf (alist-get 'org-mode gptel-prompt-prefix-alist)
"#+end_quote\n")
(setf (alist-get 'org-mode gptel-response-prefix-alist)
"#+begin_quote\n")
;; Add LLM model info and date at end of response
(add-hook 'gptel-post-response-hook
(defun my/gptel-add-model-info ()
(save-excursion
(search-forward
(alist-get 'org-mode gptel-prompt-prefix-alist)
nil t)
(previous-line 3)
(insert
"\n-- (" (gptel-backend-name gptel-backend)
": " gptel-model
(format-time-string "%Y-%m-%d)")))))
To avoid the response to be mixed with the original text, I would add an option to "Response to:"
Maybe one of these Response to: -b block (-b) -q quote (-q)
So the response is separated from the previous and next text. Example: