import streamlit as st
import Rag
# Set the page configuration
st.set_page_config(
page_title="Python FAQs Q&A App",
page_icon="🐍",
layout="centered",
initial_sidebar_state="expanded",
)
# Add custom CSS for styling
st.markdown("""
""", unsafe_allow_html=True)
# Main content
st.markdown('
Python FAQs Question Answering App
', unsafe_allow_html=True)
st.markdown("""
Enter your question about Python and get an instant answer! The chatbot is trained on data from the
Python FAQs.
""", unsafe_allow_html=True)
# Container for main content to avoid footer overlap
st.markdown('', unsafe_allow_html=True)
# Input for user query
query = st.text_input("Enter your question:")
# Display answer if a query is provided
if query:
answer = Rag.rag_chain.invoke(query)
st.markdown("### Answer")
st.write(answer)
else:
st.markdown("Please enter a question to get an answer.")
# Close the main content container
st.markdown('
', unsafe_allow_html=True)
# Add a footer
st.markdown("""
""", unsafe_allow_html=True)