seratch / ChatGPT-in-Slack

Swift demonstration of how to build a Slack app that enables end-users to interact with a ChatGPT bot
MIT License
441 stars 167 forks source link

Making text bold or italic sometime fails #61

Open xhiroga opened 1 year ago

xhiroga commented 1 year ago

This bot tries to reply with bold or italic, but sometime it fails.

image
seratch commented 1 year ago

Thank you for reporting this! It appears this issue could be specific to the Japanese language, which does not include spaces between words. This never occurs with English or others that use white space delimiters.

I am unsure if it's feasible to customize OpenAI API's behavior to consider such lang characteristics by modifying our system prompt, but if it works, I am happy to have such changes in this app. If someone is interested in exploring it, I am happy to be a reviwer. Also, I may check what's possible on this when I have time for it.

xhiroga commented 1 year ago

Thank you for your quick response! I really appreciate you pointing out the potential cause and suggesting a solution (improving the prompt).

Actually, thinking it might immediately improve by fixing the prompt, I tried inserting the following sentence. "for bold, italic, strikeout, and inline code blocks, insert a half-width space before the symbol."

However, in my environment at least, it started using double quotes instead of backquotes for programming word...😅 I realized that prompt engineering can be quite profound. I’m not in urgent trouble, so there is no need for prioritized support, and of course, I welcome suggestions for corrections from others as well!

bradyriddle commented 11 months ago

It's a workaround, but if you need it this worked for me:

https://www.howtogeek.com/450030/how-to-enable-classic-markdown-text-formatting-in-slack/