chainlit
chainlit copied to clipboard
chainlit.context.ChainlitContextException: Chainlit context not found when trying cl.user_session.get("languages") in set_starters function
trafficstars
Describe the bug I am getting chainlit.context.ChainlitContextException: Chainlit context not found when trying to get languages stored in the user_session in set_starters function.
To Reproduce Steps to reproduce the behavior:
- Run server with -w
- Type 'cl.user_session.get("languages")' in set_starters function.
- See error
Expected behavior My goal is to get users' browser language, do a conditional check and return conversational starters in their language. cl.user_session.get("languages") works in the other decorators like on_message and on_chat_start. I want it to work on set_starters as well.
Screenshots