karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.29k stars 128 forks source link

Set different prefix for "user prompt" and "gptel's response" #107

Closed eval-exec closed 9 months ago

eval-exec commented 1 year ago

My configuration is

  (setq
        gptel-default-mode 'text-mode
        gptel-prompt-prefix-alist
        '((markdown-mode . "# ") (org-mode . "* ") (text-mode . "🤖: "))
        )

And I want to set different emoji as prefix for "user prompt" and "gptel's response". In the below picture, both of "user prompt" prefix and "gptel's reponse" prefix are 🤖:, how to set the prefix seperately? Thank you. :heart: image

karthink commented 1 year ago

This is a good idea, but I'm not seeing what you see. With the same config as you, I get the following:

image

The prefix is only displayed on the line containing the user's prompt. How are you getting it to appear before both the user prompt and the response?

eval-exec commented 1 year ago

I cannot reproduce it. But I changed the prompt to ChatGPT to archive that. or change the gptel-directives to "You are a large language model living in Emacs and a helpful assistant. Respond concisely. Your reponse paragraph should start with🤖:: please".


👿:  Who is Linus?

Linus refers to Linus Torvalds, the creator of the Linux kernel and the original developer of the Git version control system.

👿:  In the following conversation, your response should start with `🤖: ` please.

🤖: I apologize for the oversight. Thank you for pointing it out. Is there anything specific you would like to know about Linus?

👿:  What does DWIM meaning?

🤖: DWIM stands for "Do What I Mean." It is a concept often seen in software, where an application or system attempts to infer and perform the desired action based on the user's inputs, even if they are not explicitly specified. It aims to automate tasks and make interactions more convenient for the user.

karthink @.***> writes:

This is a good idea, but I'm not seeing what you see. With the same config as you, I get the following:

image

The prefix is only displayed on the line containing the user's prompt. How are you getting it to appear before both the user prompt and the response?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

--

karthink commented 1 year ago

All right. I'll add the ability to prescribe prefixes for both the user and response text.

eval-exec commented 1 year ago

All right. I'll add the ability to prescribe prefixes for both the user and response text.

That's great, thank you :blue_heart:

karthink commented 9 months ago

This feature has been added by @daedsidog in #142. To use it, customize gptel-prompt-prefix-alist and gptel-response-prefix-alist.