manateelazycat / mind-wave

Emacs AI plugin based on ChatGPT API
GNU General Public License v3.0
159 stars 25 forks source link

No line breaks in code examples when chat becomes long. #23

Closed thanhvg closed 1 year ago

thanhvg commented 1 year ago

Hi, thanks for this awesome package. I am encountering a weird behaviour in chat mode, seeking any hints to troubleshoot it.

In chat mode when I ask about a coding problem, in the first couples question I would get nice response with code examples properly formatted. But then after that, chatgpt would reply code examples without any line breaks. Just one line. I ask it to reformat it, sometimes it does sometimes doesn't. If I start a new conversation with the same last question from previous chat, the output from chatgpt is fine again.

I don't think my chat reaches the token limit otherwise it would throw error in *mind-wave* buffer.

Do you have this issue on your side?

manateelazycat commented 1 year ago

yes i have, its a bug of ChatGPT itself

you need tell him re-format above code with markdown snytax

thanhvg commented 1 year ago

I think i found the problem, I just push an MR. Basically we should not drop new lines in the payload we send to chatgpt. It would confuse chatgpt.

thanhvg commented 1 year ago

problem resolved