Echo bot
This commit is contained in:
		
							
								
								
									
										11
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								app.py
									
									
									
									
									
								
							@@ -1,3 +1,12 @@
 | 
				
			|||||||
import streamlit as st
 | 
					import streamlit as st
 | 
				
			||||||
 | 
					
 | 
				
			||||||
st.write("Hello World")
 | 
					st.title("Echo Bot")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Initialize chat history
 | 
				
			||||||
 | 
					if "messages" not in st.session_state:
 | 
				
			||||||
 | 
					    st.session_state.messages = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Display chat messages from history on app rerun
 | 
				
			||||||
 | 
					for message in st.session_state.messages:
 | 
				
			||||||
 | 
					    with st.chat_message(message["role"]):
 | 
				
			||||||
 | 
					        st.markdown(message["content"])
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user