Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
def main():
|
4 |
+
st.title("Chat Application (Like WhatsApp)")
|
5 |
+
|
6 |
+
if "messages" not in st.session_state:
|
7 |
+
st.session_state["messages"] = []
|
8 |
+
|
9 |
+
user_input = st.text_input("Enter your message:")
|
10 |
+
|
11 |
+
if st.button("Send"):
|
12 |
+
if user_input:
|
13 |
+
st.session_state["messages"].append(f"You: {user_input}")
|
14 |
+
|
15 |
+
st.subheader("Chat History")
|
16 |
+
for message in st.session_state["messages"]:
|
17 |
+
st.write(message)
|
18 |
+
|
19 |
+
if __name__ == "__main__":
|
20 |
+
main()
|