Prajwal3009's picture
Upload 9 files
861129c verified
raw
history blame contribute delete
854 Bytes
import streamlit as st
from utilities import *
st.set_page_config(page_title="CVE Chatbot", page_icon=":robot:")
st.title("CVE Information Chatbot :robot:")
if "messages" not in st.session_state:
st.session_state.messages = []
for msg in st.session_state.messages:
with st.chat_message(msg["role"]):
st.markdown(msg["content"])
user_input = st.chat_input("You:")
if user_input:
st.session_state.messages.append({"role": "user", "content": user_input})
with st.chat_message("user"):
st.markdown(user_input)
with st.spinner("Thinking..."):
response = get_chatbot_response(user_input)
st.session_state.messages.append({"role": "assistant", "content": response})
with st.chat_message("assistant"):
st.markdown(response)