SHAMIL SHAHBAZ AWAN commited on
Commit
2c5039a
·
verified ·
1 Parent(s): b1b5a3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +104 -93
app.py CHANGED
@@ -66,97 +66,108 @@ else:
66
  else:
67
  st.warning("Please enter your location to get recommendations.")
68
 
69
- # New Features
70
-
71
- # Types of Internet Connections
72
- def types_of_internet_connections():
73
- st.subheader("Types of Internet Connections")
74
- st.markdown("""
75
- In rural areas, you may encounter various types of internet connections. Each has its pros and cons, depending on your needs:
76
-
77
- - **Satellite Internet**:
78
- - Good for remote areas where no other connectivity is available.
79
- - Pros: Available almost everywhere.
80
- - Cons: Can be expensive and has higher latency.
81
-
82
- - **4G/5G LTE**:
83
- - Increasingly popular in rural areas.
84
- - Pros: Affordable, high-speed internet.
85
- - Cons: Coverage may be limited in remote regions.
86
-
87
- - **Fiber Optic**:
88
- - The fastest connection type.
89
- - Pros: Very fast speeds (up to 1 Gbps).
90
- - Cons: Limited availability in rural areas.
91
-
92
- - **DSL (Digital Subscriber Line)**:
93
- - Common in many rural areas.
94
- - Pros: Reliable, affordable.
95
- - Cons: Slower speeds compared to fiber or LTE.
96
-
97
- - **Fixed Wireless**:
98
- - Uses radio signals to provide internet access.
99
- - Pros: Available in remote areas, affordable.
100
- - Cons: Speeds vary based on distance from the tower.
101
-
102
- - **Dial-Up**:
103
- - Rarely used nowadays, but still present in some rural areas.
104
- - Pros: Available anywhere a phone line exists.
105
- - Cons: Very slow speeds, high latency.
106
- """)
107
-
108
- # Educational Resources
109
- def educational_resources():
110
- st.subheader("Educational Resources on Internet Connectivity")
111
- st.markdown("""
112
- Here are some useful educational resources to help you understand how internet connectivity works and how it can be improved in rural areas:
113
-
114
- - **Internet Basics**:
115
- - [How the Internet Works](https://www.explainthatstuff.com/how-the-internet-works.html) – A simple guide to understanding the basics of internet technology.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- - **Improving Rural Connectivity**:
118
- - [The State of Rural Broadband](https://www.broadbandnow.com/research/state-of-broadband) – Research on rural broadband and how to improve it.
119
-
120
- - **Satellite Internet**:
121
- - [Satellites for Internet](https://www.explainingthecloud.com/satellite-internet/) – A guide to how satellite internet works.
122
-
123
- - **Wi-Fi Technology**:
124
- - [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.
125
-
126
- - **Internet Safety**:
127
- - [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.
128
- """)
129
-
130
- # Energy-Efficient Connectivity Solutions
131
- def energy_efficient_connectivity():
132
- st.subheader("Energy-Efficient Connectivity Solutions")
133
- st.markdown("""
134
- In rural areas, where power supply can be inconsistent, energy-efficient internet solutions are important. Here are a few options to consider:
135
-
136
- - **Solar-Powered Internet Solutions**:
137
- - Many rural areas are turning to solar-powered routers and internet infrastructure to provide a sustainable internet connection.
138
- - Pros: Green, cost-effective in the long run.
139
- - Cons: Initial setup costs, weather dependency.
140
-
141
- - **Energy-Efficient Modems and Routers**:
142
- - 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.
143
- - Look for Energy Star-certified devices.
144
-
145
- - **Low Power IoT Devices**:
146
- - For rural communities that rely on low-cost, low-power internet, Internet of Things (IoT) devices can be energy-efficient.
147
- - Use IoT to monitor remote areas, for smart agriculture, and more.
148
-
149
- - **Energy-Efficient Data Centers**:
150
- - If you are running a local data center in rural areas, look for solutions that use renewable energy (wind, solar) to power your infrastructure.
151
-
152
- - **Smart Grid Technologies**:
153
- - 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.
154
- """)
155
-
156
- # Display Additional Features
157
- if needs == "Types of Internet Connections":
158
- types_of_internet_connections()
159
- elif needs == "Educational Resources":
160
- educational_resources()
161
- elif needs == "Energy-Efficient Connectivity Solutions":
162
- energy_efficient_connectivity()
 
66
  else:
67
  st.warning("Please enter your location to get recommendations.")
68
 
69
+ # New Features
70
+
71
+ # Types of Internet Connections
72
+ def types_of_internet_connections():
73
+ st.subheader("Types of Internet Connections")
74
+ st.markdown("""
75
+ In rural areas, you may encounter various types of internet connections. Each has its pros and cons, depending on your needs:
76
+
77
+ - **Satellite Internet**:
78
+ - Good for remote areas where no other connectivity is available.
79
+ - Pros: Available almost everywhere.
80
+ - Cons: Can be expensive and has higher latency.
81
+
82
+ - **4G/5G LTE**:
83
+ - Increasingly popular in rural areas.
84
+ - Pros: Affordable, high-speed internet.
85
+ - Cons: Coverage may be limited in remote regions.
86
+
87
+ - **Fiber Optic**:
88
+ - The fastest connection type.
89
+ - Pros: Very fast speeds (up to 1 Gbps).
90
+ - Cons: Limited availability in rural areas.
91
+
92
+ - **DSL (Digital Subscriber Line)**:
93
+ - Common in many rural areas.
94
+ - Pros: Reliable, affordable.
95
+ - Cons: Slower speeds compared to fiber or LTE.
96
+
97
+ - **Fixed Wireless**:
98
+ - Uses radio signals to provide internet access.
99
+ - Pros: Available in remote areas, affordable.
100
+ - Cons: Speeds vary based on distance from the tower.
101
+
102
+ - **Dial-Up**:
103
+ - Rarely used nowadays, but still present in some rural areas.
104
+ - Pros: Available anywhere a phone line exists.
105
+ - Cons: Very slow speeds, high latency.
106
+ """)
107
+
108
+ # Educational Resources
109
+ def educational_resources():
110
+ st.subheader("Educational Resources on Internet Connectivity")
111
+ st.markdown("""
112
+ Here are some useful educational resources to help you understand how internet connectivity works and how it can be improved in rural areas:
113
+
114
+ - **Internet Basics**:
115
+ - [How the Internet Works](https://www.explainthatstuff.com/how-the-internet-works.html) – A simple guide to understanding the basics of internet technology.
116
+
117
+ - **Improving Rural Connectivity**:
118
+ - [The State of Rural Broadband](https://www.broadbandnow.com/research/state-of-broadband) – Research on rural broadband and how to improve it.
119
+
120
+ - **Satellite Internet**:
121
+ - [Satellites for Internet](https://www.explainingthecloud.com/satellite-internet/) – A guide to how satellite internet works.
122
+
123
+ - **Wi-Fi Technology**:
124
+ - [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.
125
+
126
+ - **Internet Safety**:
127
+ - [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.
128
+ """)
129
+
130
+ # Energy-Efficient Connectivity Solutions
131
+ def energy_efficient_connectivity():
132
+ st.subheader("Energy-Efficient Connectivity Solutions")
133
+ st.markdown("""
134
+ In rural areas, where power supply can be inconsistent, energy-efficient internet solutions are important. Here are a few options to consider:
135
+
136
+ - **Solar-Powered Internet Solutions**:
137
+ - Many rural areas are turning to solar-powered routers and internet infrastructure to provide a sustainable internet connection.
138
+ - Pros: Green, cost-effective in the long run.
139
+ - Cons: Initial setup costs, weather dependency.
140
+
141
+ - **Energy-Efficient Modems and Routers**:
142
+ - 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.
143
+ - Look for Energy Star-certified devices.
144
+
145
+ - **Low Power IoT Devices**:
146
+ - For rural communities that rely on low-cost, low-power internet, Internet of Things (IoT) devices can be energy-efficient.
147
+ - Use IoT to monitor remote areas, for smart agriculture, and more.
148
+
149
+ - **Energy-Efficient Data Centers**:
150
+ - If you are running a local data center in rural areas, look for solutions that use renewable energy (wind, solar) to power your infrastructure.
151
+
152
+ - **Smart Grid Technologies**:
153
+ - 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.
154
+ """)
155
+
156
+ # Display Additional Features
157
+ if needs == "Types of Internet Connections":
158
+ types_of_internet_connections()
159
+ elif needs == "Educational Resources":
160
+ educational_resources()
161
+ elif needs == "Energy-Efficient Connectivity Solutions":
162
+ energy_efficient_connectivity()
163
+
164
+ # Optional Query Box for Additional Questions
165
+ st.sidebar.header("Have Another Query?")
166
+ user_query = st.sidebar.text_input("Ask a Question (Optional)", "")
167
 
168
+ if user_query:
169
+ st.subheader(f"Your Query: {user_query}")
170
+ # Get response from Groq for the additional user query
171
+ query_response = enhance_with_groq(user_query)
172
+ st.write("Response from Groq:")
173
+ st.write(query_response)