karthink / gptel

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

add optional system message argument to gptel--create-prompt #89

Closed neilfulwiler closed 1 year ago

neilfulwiler commented 1 year ago

not sure if this was a deliberate choice but I assumed it wasn't, I was playing around with gtpel-request and wanted to use the builtin prompt functionality but with a custom system message

karthink commented 1 year ago

Thanks for catching that, I hadn't considered a nil prompt + custom system message.

I'd like to avoid modifying gptel--system-prompt for now, as it needs to be rewritten to support more LLMs soon. Please see the code review for an alternative.

neilfulwiler commented 1 year ago

assuming you mean an upcoming code review, cause I don't see one now (but maybe I don't know how to github). if you haven't gotten around to it yet the other way I could do this is just get the prompt list and pop off the system message and add the custom one back, not sure how stable that data format is though

karthink commented 1 year ago

2023-07-13-142516_930x886_scrot Not sure why it's not showing up.

Reproduced here:

Instead of modifying gptel--create-prompt, please let-bind gptel--system-message around the call to gptel--create-prompt in gptel-request. Something like this:

          ((null prompt)
           (let ((gptel--system-message
                  (or system gptel--system-message)))
             (gptel--create-prompt start-marker)))
neilfulwiler commented 1 year ago

ah its pending you gotta hit submit, also that makes way more sense than what I said

karthink commented 1 year ago

Cheers @neilfulwiler.