emacs-openai / chatgpt

Use ChatGPT inside Emacs
GNU General Public License v3.0
185 stars 21 forks source link

Delete the "Type respone here..." prompt when the user starts typing #16

Closed RJTK closed 1 year ago

RJTK commented 1 year ago

I added a post-self-insert-hook to delete the prompting text when the user starts typing. Please let me know if there's a better way to implement this -- I only have a rather cursory knowledge of elisp.

Also fixed some oddities with the top-p parameter. I should have defaulted it to nil instead of 1.0 (even though they're currently equivalent AFAIK), and there was no "\n" in the chatgpt-info for that parmaeter

jcs090218 commented 1 year ago

I added a post-self-insert-hook to delete the prompting text when the user starts typing. Please let me know if there's a better way to implement this -- I only have a rather cursory knowledge of elisp.

My preferred solution is https://github.com/emacs-openai/chatgpt/issues/9#issuecomment-1495506341.

Also fixed some oddities with the top-p parameter. I should have defaulted it to nil instead of 1.0 (even though they're currently equivalent AFAIK), and there was no "\n" in the chatgpt-info for that parmaeter

Thank you!👍 🚀

jcs090218 commented 1 year ago

I've applied some of the fix in c75901ae8dcd90b2eacb4de4a1a55c4c082b68ef. Does that work for you? 🤔 Thanks!

RJTK commented 1 year ago

Sorry I was slow on this -- it looks like fixes were applied in a different commit, and this method of deleting the prompt is pretty bad and it should instead use delete-selection-mode? Anything else I can do here? Otherwise fine to close :)

jcs090218 commented 1 year ago

No worries! I forgot to reply to this thread too! 😓

it should instead use delete-selection-mode?

delete-selection-mode is one of the solutions since the text should already be selected, so you would just need to start typing since the text will go away after the first input. But now you can just set the variable chatgpt-window-prompt to an empty string so it wouldn't insert anything.

And again, thanks for the contribution! 😋 ❤️