Chainlit / docs

10 stars 79 forks source link

Issue on docs - You need to configure at least an on_chat_start or an on_message callback #97

Closed ThrivingHenry closed 1 month ago

ThrivingHenry commented 9 months ago

Path: /integrations/langchain

I installed langchain + chainlit, set my .env with my openAI key, and copied the async LCEL code identically to my app.py.

When I run "chainlit run app.py -w" it shows: image

In terminal, it shows: You need to configure at least an on_chat_start or an on_message callback but it's clearly defined in the default code.

Any sense what I could have done wrong here?

willydouhard commented 9 months ago

What version of chainlit are you using? Also does it work if you remove -w?

mikeolubode commented 4 months ago

I am not the OP but I have the same issues, It didn't work after removing -w Removing if __name__=='__main__' solved it for me

ModEnter commented 1 month ago

This issue has been fixed in more recent versions. I'm closing the issue. The code snippet for async LCEL langchain/openAI integration gives the following window :

image