SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files65 unmodified lines6667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116265 unmodified lineselse:st.warning("Please enter your location to get recommendations.")# New Features# Types of Internet Connectionsdef types_of_internet_connections():st.subheader("Types of Internet Connections")st.markdown("""In rural areas, you may encounter various types of internet connections. Each has its pros and cons, depending on your needs:- **Satellite Internet**:- Good for remote areas where no other connectivity is available.- Pros: Available almost everywhere.- Cons: Can be expensive and has higher latency.- **4G/5G LTE**:- Increasingly popular in rural areas.- Pros: Affordable, high-speed internet.- Cons: Coverage may be limited in remote regions.- **Fiber Optic**:- The fastest connection type.- Pros: Very fast speeds (up to 1 Gbps).- Cons: Limited availability in rural areas.- **DSL (Digital Subscriber Line)**:- Common in many rural areas.- Pros: Reliable, affordable.- Cons: Slower speeds compared to fiber or LTE.- **Fixed Wireless**:- Uses radio signals to provide internet access.- Pros: Available in remote areas, affordable.- Cons: Speeds vary based on distance from the tower.- **Dial-Up**:- Rarely used nowadays, but still present in some rural areas.- Pros: Available anywhere a phone line exists.- Cons: Very slow speeds, high latency.""")# Educational Resourcesdef educational_resources():st.subheader("Educational Resources on Internet Connectivity")st.markdown("""Here are some useful educational resources to help you understand how internet connectivity works and how it can be improved in rural areas:- **Internet Basics**:- [How the Internet Works](https://www.explainthatstuff.com/how-the-internet-works.html) β A simple guide to understanding the basics of internet technology.- **Improving Rural Connectivity**:- [The State of Rural Broadband](https://www.broadbandnow.com/research/state-of-broadband) β Research on rural broadband and how to improve it.- **Satellite Internet**:- [Satellites for Internet](https://www.explainingthecloud.com/satellite-internet/) β A guide to how satellite internet works.- **Wi-Fi Technology**:- [How Wi-Fi Works](https://www.wi-fi.org/discover-wi-fi) β Learn about the technology behind Wi-Fi and how it can be optimized.- **Internet Safety**:- [Staying Safe Online](https://www.getsafeonline.org/) β A comprehensive resource for understanding internet safety, especially in rural communities where online security might be a concern.""")# Energy-Efficient Connectivity Solutionsdef energy_efficient_connectivity():st.subheader("Energy-Efficient Connectivity Solutions")st.markdown("""In rural areas, where power supply can be inconsistent, energy-efficient internet solutions are important. Here are a few options to consider:- **Solar-Powered Internet Solutions**:- Many rural areas are turning to solar-powered routers and internet infrastructure to provide a sustainable internet connection.- Pros: Green, cost-effective in the long run.- Cons: Initial setup costs, weather dependency.- **Energy-Efficient Modems and Routers**:- Choose modems and routers that are designed to consume less power, especially if you're running a small community network or a home-based system.- Look for Energy Star-certified devices.- **Low Power IoT Devices**:- For rural communities that rely on low-cost, low-power internet, Internet of Things (IoT) devices can be energy-efficient.- Use IoT to monitor remote areas, for smart agriculture, and more.- **Energy-Efficient Data Centers**:- If you are running a local data center in rural areas, look for solutions that use renewable energy (wind, solar) to power your infrastructure.- **Smart Grid Technologies**:- Use smart grid technologies to balance energy usage while maintaining a reliable internet connection. These technologies are being adopted in rural areas to improve energy distribution and reduce energy consumption.""")# Display Additional Featuresif needs == "Types of Internet Connections":types_of_internet_connections()elif needs == "Educational Resources":educational_resources()elif needs == "Energy-Efficient Connectivity Solutions":energy_efficient_connectivity()65 unmodified lines6667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217365 unmodified lineselse:st.warning("Please enter your location to get recommendations.")# New Features# Types of Internet Connectionsdef types_of_internet_connections():st.subheader("Types of Internet Connections")st.markdown("""In rural areas, you may encounter various types of internet connections. Each has its pros and cons, depending on your needs:- **Satellite Internet**:- Good for remote areas where no other connectivity is available.- Pros: Available almost everywhere.- Cons: Can be expensive and has higher latency.- **4G/5G LTE**:- Increasingly popular in rural areas.- Pros: Affordable, high-speed internet.- Cons: Coverage may be limited in remote regions.- **Fiber Optic**:- The fastest connection type.- Pros: Very fast speeds (up to 1 Gbps).- Cons: Limited availability in rural areas.- **DSL (Digital Subscriber Line)**:- Common in many rural areas.- Pros: Reliable, affordable.- Cons: Slower speeds compared to fiber or LTE.- **Fixed Wireless**:- Uses radio signals to provide internet access.- Pros: Available in remote areas, affordable.- Cons: Speeds vary based on distance from the tower.- **Dial-Up**:- Rarely used nowadays, but still present in some rural areas.- Pros: Available anywhere a phone line exists.- Cons: Very slow speeds, high latency.""")# Educational Resourcesdef educational_resources():st.subheader("Educational Resources on Internet Connectivity")st.markdown("""Here are some useful educational resources to help you understand how internet connectivity works and how it can be improved in rural areas:- **Internet Basics**:- [How the Internet Works](https://www.explainthatstuff.com/how-the-internet-works.html) β A simple guide to understanding the basics of internet technology.- **Improving Rural Connectivity**:- [The State of Rural Broadband](https://www.broadbandnow.com/research/state-of-broadband) β Research on rural broadband and how to improve it.- **Satellite Internet**:- [Satellites for Internet](https://www.explainingthecloud.com/satellite-internet/) β A guide to how satellite internet works.- **Wi-Fi Technology**:- [How Wi-Fi Works](https://www.wi-fi.org/discover-wi-fi) β Learn about the technology behind Wi-Fi and how it can be optimized.- **Internet Safety**:- [Staying Safe Online](https://www.getsafeonline.org/) β A comprehensive resource for understanding internet safety, especially in rural communities where online security might be a concern.""")# Energy-Efficient Connectivity Solutionsdef energy_efficient_connectivity():st.subheader("Energy-Efficient Connectivity Solutions")st.markdown("""In rural areas, where power supply can be inconsistent, energy-efficient internet solutions are important. Here are a few options to consider:- **Solar-Powered Internet Solutions**:- Many rural areas are turning to solar-powered routers and internet infrastructure to provide a sustainable internet connection.- Pros: Green, cost-effective in the long run.- Cons: Initial setup costs, weather dependency.- **Energy-Efficient Modems and Routers**:- Choose modems and routers that are designed to consume less power, especially if you're running a small community network or a home-based system.- Look for Energy Star-certified devices.- **Low Power IoT Devices**:- For rural communities that rely on low-cost, low-power internet, Internet of Things (IoT) devices can be energy-efficient.- Use IoT to monitor remote areas, for smart agriculture, and more.- **Energy-Efficient Data Centers**:- If you are running a local data center in rural areas, look for solutions that use renewable energy (wind, solar) to power your infrastructure.- **Smart Grid Technologies**:- Use smart grid technologies to balance energy usage while maintaining a reliable internet connection. These technologies are being adopted in rural areas to improve energy distribution and reduce energy consumption.""")# Display Additional Featuresif needs == "Types of Internet Connections":types_of_internet_connections()elif needs == "Educational Resources":educational_resources()elif needs == "Energy-Efficient Connectivity Solutions":energy_efficient_connectivity()# Optional Query Box for Additional Questionsst.sidebar.header("Have Another Query?")user_query = st.sidebar.text_input("Ask a Question (Optional)", "")if user_query:st.subheader(f"Your Query: {user_query}")# Get response from Groq for the additional user queryquery_response = enhance_with_groq(user_query)st.write("Response from Groq:")st.write(query_response)
app.py+104-93