Closed tshu-w closed 12 months ago
If I understand correctly, you want to classify a response message from ChatGPT as a user prompt.
For the purpose of (repeatedly) rewriting text, you could just use the rewrite feature built into gptel. Select the text to be rewritten, then gptel-menu
-> r
-> R
. This should work no matter the source of the text selected (i.e. ChatGPT or you). Is there some reason you don't want to do it this way?
If I understand correctly, you want to classify a response message from ChatGPT as a user prompt.
Yes, this is what I need, or gptel
consider all content as 'user' with an option, regardless of its property.
I am not using the default rewrite because I have many different directives that implement "rewriting", such as translation, paraphrasing, abbreviation, etc.
(maybe misunderstanding but if you universal prefix arg before the rewrite can't you edit the prompt to select on of these many rewrite directives?)
maybe misunderstanding but if you universal prefix arg before the rewrite can't you edit the prompt to select on of these many rewrite directives?
I didn't realize before that the rewrite directive can also be modified, but it's not possible to select "gptel-directives" and must be manually entered, which makes it difficult to switch directives frequently.
Yes, the UI for selecting rewrite directives needs to be better. I'll try to improve it soon.
On Mon, Jun 12, 2023, 6:55 AM Tianshu Wang @.***> wrote:
maybe misunderstanding but if you universal prefix arg before the rewrite can't you edit the prompt to select on of these many rewrite directives?
I didn't realize before that the rewrite directive can also be modified, but it's not possible to select "gptel-directives" and must be manually entered, which makes it difficult to switch directives frequently. [image: Screenshot 2023-06-12 at 21 52 47] https://user-images.githubusercontent.com/13161779/245165265-d763f69c-fd19-4321-8807-3b7195b85a82.png
— Reply to this email directly, view it on GitHub https://github.com/karthink/gptel/issues/73#issuecomment-1587390655, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBVOLBRK7NGVIJUIU5JAXDXK4NUHANCNFSM6AAAAAAZC3VJCU . You are receiving this because you commented.Message ID: @.***>
but it's not possible to select "gptel-directives" and must be manually entered, which makes it difficult to switch directives frequently.
I took a look at this, and realized the history of rewrite directives is already saved. You can access all previously used directives with M-n
and M-p
in the minibuffer prompt. If you use savehist-mode
, it is persisted across Emacs sessions.
Putting aside the original intention, I still want to know if there is a way to set up the face of the reply, so as to better distinguish between the original content and the reply.
You could try something like this:
(defun gptel--color-response ()
(let ((prop))
(save-excursion
(setq prop (text-property-search-forward 'gptel 'response t))
(put-text-property (prop-match-beginning prop)
(prop-match-end prop)
'font-lock-face
'warning))))
(add-hook 'gptel-post-response-hook #'gptel--color-response t)
Replace the warning
face with whatever you need.
I'm using
gptel
to refine my writing. Sometimes I modify and resend responses to OpenAI to get new replies. I want to add a face to the response text so that I can realize clear text properties when resending the modified response. Otherwise,gptel
will divide it into multiple prompts. I tried the following code but it didn't work. Any suggestions would be greatly appreciated.