File size: 514 Bytes
35924d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import streamlit as st

def main():
    st.title("Chat Application (Like WhatsApp)")
    
    if "messages" not in st.session_state:
        st.session_state["messages"] = []
    
    user_input = st.text_input("Enter your message:")
    
    if st.button("Send"):
        if user_input:
            st.session_state["messages"].append(f"You: {user_input}")
    
    st.subheader("Chat History")
    for message in st.session_state["messages"]:
        st.write(message)
    
if __name__ == "__main__":
    main()