import streamlit as st st.set_page_config(page_title="2023 FS Hackathon") st.title("Founder's Studio AI Sandbox 🕹ī¸") expander = st.expander("Click here to close this intro", expanded=True) expander.write( """ This web app allows you to perform common Natural Language Processing tasks, select a task below to get started. These tasks are intended to help you validate your intuition and build a proof of concept for your idea. If a task you deem useful is not listed here, feel free to get in touch with Founder's Studio team at francesco.capuano@bain.com. Happy hackathon! """ ) st.subheader(":point_down: Use the following drop-down menu to select a task!") OPTION1="Chat with a file đŸ’Ŧ📖" OPTION2="Text summarization 🔎" OPTION_N="Other 🤔" col1, col2 = st.columns(2) with col1: option = st.radio( "Please select a task 🤖", options=[OPTION1, OPTION2, OPTION_N], key="task_selection" ) with col2: confirm = st.button("Confirm", key="task_selection_confirm") if confirm: st.session_state["task_confirmed"] = True if st.session_state.get("task_confirmed"): # only execute the actual app code when the user confirms the task selection if st.session_state.get("task_selection") == OPTION1: from qa import qa_main with st.container(): qa_main() elif st.session_state.get("task_selection") == OPTION2: from summarization import summarization_main with st.container(): summarization_main() elif st.session_state.get("task_selection") == OPTION_N: from mailing import mailing_main with st.container(): user_suggestion = st.text_input( "What other task would you like to perform?", placeholder="Transform meeting transcripts into rainbow-colored unicorns" ) if user_suggestion: st.write(""" Thanks for contributing with your suggestion! We are carefully reviewing every suggestion. If you wish to further discuss your task suggestion, consider reaching out to francesco.capuano@bain.com. We will get back to you as soon as possible! """) mailing_main( subject="**NEW TASK SUGGESTION** - Automatic email.", body=f"User suggestion\n: {user_suggestion}", to_address="francesco.capuano@bain.com" ) st.stop()