Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -131,7 +131,13 @@ def generate_suggestions(emotion):
|
|
131 |
["Relaxation Video", "https://youtu.be/m1vaUGtyo-A"],
|
132 |
],
|
133 |
}
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
def get_health_professionals_and_map(location, query):
|
137 |
"""Search nearby healthcare professionals using Google Maps API."""
|
@@ -146,7 +152,7 @@ def get_health_professionals_and_map(location, query):
|
|
146 |
professionals = []
|
147 |
map_ = folium.Map(location=(lat, lng), zoom_start=13)
|
148 |
for place in places_result:
|
149 |
-
#
|
150 |
professionals.append([place['name'], place.get('vicinity', 'No address provided')])
|
151 |
folium.Marker(
|
152 |
location=[place["geometry"]["location"]["lat"], place["geometry"]["location"]["lng"]],
|
|
|
131 |
["Relaxation Video", "https://youtu.be/m1vaUGtyo-A"],
|
132 |
],
|
133 |
}
|
134 |
+
|
135 |
+
# Format the output to include HTML anchor tags
|
136 |
+
formatted_suggestions = [
|
137 |
+
[title, f'<a href="{link}" target="_blank">{link}</a>'] for title, link in suggestions.get(emotion_key, [["No specific suggestions available.", "#"]])
|
138 |
+
]
|
139 |
+
|
140 |
+
return formatted_suggestions
|
141 |
|
142 |
def get_health_professionals_and_map(location, query):
|
143 |
"""Search nearby healthcare professionals using Google Maps API."""
|
|
|
152 |
professionals = []
|
153 |
map_ = folium.Map(location=(lat, lng), zoom_start=13)
|
154 |
for place in places_result:
|
155 |
+
# Use a list of values to append each professional
|
156 |
professionals.append([place['name'], place.get('vicinity', 'No address provided')])
|
157 |
folium.Marker(
|
158 |
location=[place["geometry"]["location"]["lat"], place["geometry"]["location"]["lng"]],
|