cl.instrument_openai()
after creating your OpenAI client.
app.py
in your project directory. This file will contain the main logic for your LLM application.
app.py
, import the necessary packages and define one function to handle messages incoming from the UI.
.env
in the same folder as your app.py
file. Add your OpenAI API key in the OPENAI_API_KEY
variable.
app.py
. Then run the following command:
-w
flag tells Chainlit to enable auto-reloading, so you don’t need to restart the server every time you make changes to your application. Your chatbot UI should now be accessible at http://localhost:8000.