chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Avatars doesn't work for non-English cl.Step name

Open AbdulrahmanAlGhofaily opened this issue 11 months ago • 4 comments
trafficstars

Bug description Avatars doesn't work for languages that doesn't use English letters. I've tried to use cl.Step with the name="اسم عربي" an Arabic name. Chainlit will attempt to access the image with the same name as cl.Step name (اسم عربي.png). First it will encode it to "%D8%A7%D8%B3%D9%85+%D8%B9%D8%B1%D8%A8%D9%8A" then it will try to access the file with same previous encoded name which cause it to fail and throw an error in the console. (Tried to set the avatar name to "اسم عربي.png" and the encoded name.png, both didn't work)

Steps to reproduce the behavior:

  1. Set cl.Step name parameter to any non-English name (Using non-English letters).
  2. Run the application and send a message.
  3. Open browser console and check the error message there.

Expected behavior The avatar image will not show up, an error in the console indicates that the source image doesn't exist.

Screenshots image

AbdulrahmanAlGhofaily avatar Dec 01 '24 08:12 AbdulrahmanAlGhofaily