From bf5cb6fb1bbd2117dd5d831a249df0f85e847f0c Mon Sep 17 00:00:00 2001 From: Hello_User Date: Sun, 23 Jun 2024 14:12:45 +0000 Subject: [PATCH] Add chatbot messages to history (I think) --- app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app.py b/app.py index fcd443b..3e1b49c 100644 --- a/app.py +++ b/app.py @@ -18,3 +18,10 @@ if prompt := st.chat_input("What is up?"): st.markdown(prompt) # Add user message to chat history st.session_state.messages.append({"role": "user", "content": prompt}) + +response = f"Echo: {prompt}" +# Display assistant response in chat message container +with st.chat_message("assistant"): + st.markdown(response) +# Add assistant response to chat history +st.session_state.messages.append({"role": "assistant", "content": response}) \ No newline at end of file