Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
7.13k stars 935 forks source link

Callback handles UTF-8 characters incorrectly #525

Closed Enoch2090 closed 1 year ago

Enoch2090 commented 1 year ago

When calling a LangChain runnable such as

runnable.astream(
        {'question': message.content},
        config=RunnableConfig(callbacks=[cl.LangchainCallbackHandler(stream_final_answer=True)]),
    )

The UTF-8 characters (such as Chinese characters) are output as:

msedge_November06-18-15-213b39

Haven't read the source code of Chainlit, I suspect this could be caused by simply dumping the intermediate results with json. Can 100% replicate this with any intermediate results with Chinese language.

willydouhard commented 1 year ago

Should be fixed with chainlit 0.7.500!

Enoch2090 commented 12 months ago

Updated to 0.7.500 and it is fixed. Thanks!