ai
ai copied to clipboard
Strange question marks in cyrillic symbols are still there
Original issue #155 was closed, but It seems issue is still present. Question marks still appear on https://chat.vercel.ai and in my product even after upgrade to new version with stream: true fix.
Recent screenshot from https://chat.verce.ai:
Originally posted by @TimPchelintsev in https://github.com/vercel-labs/ai/issues/155#issuecomment-1603693735
Can you log out the individual tokens that are received? Or can you explain the steps to reproduce (I don't know how to get Cyrillic responses) so we can debug?
Hi @jridgewell sure:
- Bug is present in my system, but also on https://chat.vercel.ai, so maybe it will be convenient to debug there?
- ChatGPT is multilingual so we can ask any question in Russian language to trigger response with cyrillic symbols,
l personaly used
"Расскажи сказку"("Tell me a fairytail" in English) - So to reproduce please visit https://chat.vercel.ai and copy-paste
"Расскажи сказку". - Question marks seems to appear in completely random positions, but they appear almost every time in long enough AI response.
Please tell me if you need more information or I can help somehow, this bug is really annoying and I think it can be present not only in cyrillic symbols, but in broader range of symbols too.
P.S. I should mention that bug is not present on https://chat.openai.com, so problem should be somewhere in-between.
Is this still an issue @TimPchelintsev? I can't reproduce it anymore
Hi @MaxLeiter, thanks for your response, you made my day.
Well, it seems we finally nailed it.
First I checked https://chat.vercel.ai and confirmed that I did not see bug there anymore.
Than I upgraded all related packages, still saw bug in my project, but after comparing codebases it seems I found solution:https://github.com/vercel/ai/blob/b84af19b2b2b54b045558d35925abcfcff8d01fa/packages/core/shared/utils.ts#L29
As I used only server side code from ai package and implemented parsing streaming response in my UI myself,
I missed the { stream: true } part in my implementation.
Thank you guys you are legends!