Rohankumar31's picture
Update stream.py
1f7dbdd
raw
history blame contribute delete
948 Bytes
import streamlit as st
from main import generate_text
st.title("AI Chaperone πŸŽ—οΈ")
st.write("AI Chaperone is an advanced AI assistant meticulously designed to provide unwavering support to individuals living with Alzheimer's disease.")
if "messages" not in st.session_state:
st.session_state.messages = []
st.session_state.messages.append({
'role':'assistant',
'content':"Hi! I'm your virtual assistant you can ask any query to me"
})
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.markdown(message["content"])
prompt = st.chat_input("What is up?")
if prompt:
with st.chat_message("user"):
st.markdown(prompt)
st.session_state.messages.append({"role":"user","content":prompt})
response = f"ChatBot: {generate_text(prompt)}"
with st.chat_message("assistant"):
st.markdown(response)
st.session_state.messages.append({"role":"assistant","content":response})