karthink / gptel

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

gptel-directives set variable #411

Closed silgon closed 1 month ago

silgon commented 1 month ago

Sorry for the seamless silly question. I'm trying to set the directives: image I tried to do it simply with:

(setq gptel-directives
    '((default . "You are a large language model living in Emacs and a helpful assistant. Respond concisely.")
         (programming . "You are a large language model and a careful programmer. Provide code and only code as output without any additional text, prompt, note or ```.")
         (writing . "You are a large language model and a writing assistant. Respond concisely.")
         (chat . "You are a large language model and a conversation partner. Respond concisely.")))

But it doesn't seem to do the job. I tried a bunch of other things too (with add-hook 'gptel-mode-hook, with custom-set-variables , etc) but without success. How can I set my own directives?

karthink commented 1 month ago

From your screenshot it looks like it worked? How is it failing?

silgon commented 1 month ago

gpt4o-mini is adding me always triple quote when using it as a programmer, I just included ``` for the example. However, I would like to have more and different directives also. Sorry for the subtle difference 😅

karthink commented 1 month ago

Setting gptel-directives as you do should work correctly. I'm not sure what could be going wrong. Did you use the customize interface to set its value?

silgon commented 1 month ago

I have absolutely not idea what a customized interface is. I just set the line I posted to my .emacs (actually, .emacs.d/init.el) file =)

silgon commented 1 month ago

Wow.... it's crazy, i reopened emacs I don't know how many times and nothing happened. After your reply, I just restarted again to test (and checking that I'm not becoming crazy), and well.... turns out it worked 😓. Anyway, not sure what happened, but well, programming is like that right? After x number of years you just accept it =P BTW, I saw yesterday the video for this library and the other for latex. You rock! 😉 (and it also reminded me of the time I was doing my Ph.D.). Cheers!