bramses / chatgpt-md

A (nearly) seamless integration of ChatGPT into Obsidian.
MIT License
824 stars 61 forks source link

Are trailing spaces removed? #60

Closed tophee closed 1 year ago

tophee commented 1 year ago

I just saw on the open AI website that a trailing space in the user prompt may reduce the quality of the response. So I'm just curious whether ChatGPT_MD is removing them before submission.

lukemt commented 1 year ago

Hi @tophee

I was wondering the same thing. I did not know if it would actually reduce the quality of the response, but I did have that thought! Thanks for the info.

To answer your question: Yes, they are removed. If you open the developer console (Ctrl + Shift + J for Windows and Linux, and Cmd + Opt + J for Mac) you can see the actual json that is sent to OpenAI.

If you need any further help, feel free to ask.

bramses commented 1 year ago

Hi @tophee, yeah @lukemt is correct trailing spaces are removed during message extraction pipeline.

See https://github.com/bramses/chatgpt-md/blob/master/main.ts#L335-L340