From the course: Build with AI: LLM-Powered Applications with Streamlit

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Create a chat UI in Streamlit for LLM interactions

Create a chat UI in Streamlit for LLM interactions - Python Tutorial

From the course: Build with AI: LLM-Powered Applications with Streamlit

Create a chat UI in Streamlit for LLM interactions

- [Instructor] You are doing a great job so far creating your document Q&A chatbot. Let's add to the chatbot by creating a basic chat user interface in Streamlet that echoes the user's messages. Then you will slowly add to this throughout the chapter to provide your final document Q&A chatbot. Let's get started. Let's work with the file 04_01b.py, so note that you are now in the Chapter_4 folder inside Codespaces, and make sure that you edit your OpenAI key.txt file for this particular chapter. Inside this, you'll first begin by importing your streamlet package as st and then you can configure your chat UI to have a different title that will show in your browser by doing st.set_page_config and then you'll have page_title equal to Chat UI. So note that you can adjust this page title to be whatever you want to be. It's just what will show up in that little browser window. Now let's write a title using st.title and let's have the title be Build Chat UI. You can use the same chat history…

Contents