import streamlit as st # Set the page configuration st.set_page_config( page_title="IT-support assistant", layout="wide", ) # Apply CSS for custom background and layout st.markdown( f""" """, unsafe_allow_html=True ) # Sidebar buttons st.sidebar.markdown('

Quick Help

', unsafe_allow_html=True) # Function 1: Frequently Asked Questions if st.sidebar.button('Frequently Asked Questions'): st.session_state.page = "faq" # Function 2: Internet status if st.sidebar.button('Internet status'): st.sidebar.markdown('

The internet is currently not working.

', unsafe_allow_html=True) # Function 3: Intranet status if st.sidebar.button('Intranet status'): st.sidebar.markdown('

The intranet is currently working.

', unsafe_allow_html=True) # Function 4: Contact Human Support if st.sidebar.button('Contact Human Support'): st.sidebar.markdown('

If you do not wish to use the bot feature and want to contact second level support directly, please either call them at 44 353 4434 or write them at secondlevelsupport@email.com

', unsafe_allow_html=True) # Function 5: Video Tutorials if st.sidebar.button('Video Tutorials'): st.session_state.page = "videos" # Function 6: Review IT-Support service if st.sidebar.button('Review IT-Support service'): st.session_state.page = "review" # Display the headline if 'page' not in st.session_state: st.markdown('
IT-support assistant
', unsafe_allow_html=True) # Check for pages if 'page' in st.session_state and st.session_state.page == "faq": st.markdown('

Frequently Asked Questions

', unsafe_allow_html=True) st.markdown('
', unsafe_allow_html=True) # Add FAQ content st.markdown('
Q1: How can I set up a VPN on my device?
', unsafe_allow_html=True) st.markdown('
A1: To set up a VPN, go to your device\'s network settings, choose \'Add VPN\', and enter the VPN details provided by your IT department.
', unsafe_allow_html=True) st.markdown('
Q2: What should I do if my computer is running slow?
', unsafe_allow_html=True) st.markdown('
A2: Try restarting your computer, closing unnecessary applications, and checking for available updates. If the issue persists, contact IT support.
', unsafe_allow_html=True) st.markdown('
Q3: How do I set up my email on my phone?
', unsafe_allow_html=True) st.markdown('
A3: Go to your phone\'s email settings, add a new account, and enter your email address and password. Follow the prompts to complete the setup.
', unsafe_allow_html=True) st.markdown('
', unsafe_allow_html=True) if st.button("Back to Home"): st.session_state.page = None elif 'page' in st.session_state and st.session_state.page == "videos": st.markdown('

Video Tutorials

', unsafe_allow_html=True) st.markdown('

Here you can find video tutorials to help you with common tasks.

', unsafe_allow_html=True) # Add video tutorial content here if st.button("Back to Home"): st.session_state.page = None elif 'page' in st.session_state and st.session_state.page == "review": st.markdown('

Review IT-Support service

', unsafe_allow_html=True) st.markdown('

Please provide your feedback below:

', unsafe_allow_html=True) # Star rating st.markdown( """
""", unsafe_allow_html=True ) # Feedback form feedback = st.text_area("Your comments") if st.button("Submit"): st.success("Thank you for your feedback, we will use it to improve our service.") if st.button("Back to Home"): st.session_state.page = None else: # Initialize chat session state if 'chat_history' not in st.session_state: st.session_state.chat_history = [] # Chat panel container st.markdown('
', unsafe_allow_html=True) # Display chat history for message in st.session_state.chat_history: st.markdown(f"
{message}
", unsafe_allow_html=True) # Close the chat-container div st.markdown('
', unsafe_allow_html=True) # Input form for chat with st.form(key='chat_form', clear_on_submit=True): user_input = st.text_input("Type your request here...", "") submit_button = st.form_submit_button(label='Send') if submit_button and user_input: st.session_state.chat_history.append(f"You: {user_input}") # Basic chat logic if "hello" in user_input.lower(): st.session_state.chat_history.append("Bot: Hello, how may I assist you today?") elif "password" in user_input.lower() or "locked" in user_input.lower(): st.session_state.chat_history.append("Bot: Would you like me to reset your password for you?") elif "yes please" in user_input.lower(): st.session_state.chat_history.append("Bot: Okay, I have reset your password. Please login with 12345678 as your password and then change it to a new password of your own choosing once prompted. Is there anything else I can help you with?") elif "thank you" in user_input.lower(): st.session_state.chat_history.append("Bot: You are welcome! Is there anything else I can help you with?") elif "internet" in user_input.lower() and "not" in user_input.lower(): st.session_state.chat_history.append("Bot: Please hold while I check the current status of the internet connection.") elif "delay 1" in user_input.lower(): st.session_state.chat_history.append("Bot: You are right, it does appear that the internet is not functioning. Would you like me to contact second level support to attempt to resolve the problem?") elif user_input.lower() == "yes": st.session_state.chat_history.append("Bot: Okay, please hold while I contact second level support.") elif "delay 2" in user_input.lower(): st.session_state.chat_history.append("Bot: Second level confirmed that there was an issue with the internet and have restarted the router. The internet appears to be working now. Please let me know if you are still experiencing any issues.") else: st.session_state.chat_history.append("Bot: I'm sorry, I didn't understand that. Can you please clarify?") # Refresh the chat panel to display new messages st.experimental_rerun()