import streamlit as st from rag import answer_question # Set page config st.set_page_config( page_title="Cory Booker's Marathon Speech", page_icon="🇺🇸", layout="wide" ) # Custom CSS st.markdown( """ """, unsafe_allow_html=True, ) # Header with American flag emoji st.title("🇺🇸 Cory Booker's Historic Speech") st.markdown( """

Source Material

The transcript is derived from videos in this playlist: YouTube Playlist

""", unsafe_allow_html=True, ) # Search section st.markdown( """

Explore the Speech

Ask questions about Senator Booker's historic 25-hour speech below:

""", unsafe_allow_html=True, ) text = st.text_area( "Your Question", height=150, placeholder="What would you like to know about Senator Booker's speech?", ) if st.button("Search", key="search_button"): with st.spinner("Searching through the historic transcript..."): response = answer_question(text) st.markdown( """

Answer:

{}

""".format( response ), unsafe_allow_html=True, ) # Add disclaimer about LLM hallucinations st.markdown( """

Please verify important facts and consult primary sources when possible.

""", unsafe_allow_html=True, ) # Footer st.markdown( """

🇺🇸 Celebrating American Democracy and the Power of Speech 🇺🇸

Made with ❤️ by Noah K

""", unsafe_allow_html=True, )