Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,25 +38,32 @@ st.title("St. Louis Area Neighborhood Matchmaker")
|
|
| 38 |
st.write("This tool helps you find neighborhoods in Saint Louis, Missouri, and surrounding areas based on your lifestyle preferences.")
|
| 39 |
|
| 40 |
# Using columns to organize the layout
|
| 41 |
-
col1, col2 = st.columns(
|
| 42 |
|
| 43 |
with col1:
|
| 44 |
-
|
| 45 |
amenities_list = ["Good Schools", "Parks", "Shopping Centers", "Public Transport", "Restaurants", "Gyms", "Cafes", "Pet-friendly Areas", "Cultural Attractions", "Quiet Neighborhoods"]
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
|
|
|
|
|
|
|
|
|
| 51 |
submit_button = st.button('Find Neighborhood')
|
| 52 |
|
| 53 |
with col2:
|
| 54 |
# Placeholder for the result
|
|
|
|
| 55 |
result_placeholder = st.empty()
|
| 56 |
if submit_button:
|
| 57 |
messages = initial_messages.copy()
|
| 58 |
reply, _ = CustomChatGPT(additional_details, amenities_proximity, amenities, messages)
|
| 59 |
-
result_placeholder.markdown("**Recommended Neighborhoods:**")
|
| 60 |
result_placeholder.write(reply)
|
| 61 |
else:
|
| 62 |
-
result_placeholder.write("**Results will appear here**")
|
|
|
|
| 38 |
st.write("This tool helps you find neighborhoods in Saint Louis, Missouri, and surrounding areas based on your lifestyle preferences.")
|
| 39 |
|
| 40 |
# Using columns to organize the layout
|
| 41 |
+
col1, col2 = st.columns(2)
|
| 42 |
|
| 43 |
with col1:
|
| 44 |
+
st.subheader("Your Preferences")
|
| 45 |
amenities_list = ["Good Schools", "Parks", "Shopping Centers", "Public Transport", "Restaurants", "Gyms", "Cafes", "Pet-friendly Areas", "Cultural Attractions", "Quiet Neighborhoods"]
|
| 46 |
+
# Splitting amenities into two columns
|
| 47 |
+
half = len(amenities_list) // 2
|
| 48 |
+
amenities_col1, amenities_col2 = st.columns(2)
|
| 49 |
+
with amenities_col1:
|
| 50 |
+
amenities1 = [amenity for amenity in amenities_list[:half] if st.checkbox(amenity)]
|
| 51 |
+
with amenities_col2:
|
| 52 |
+
amenities2 = [amenity for amenity in amenities_list[half:] if st.checkbox(amenity)]
|
| 53 |
+
amenities = amenities1 + amenities2
|
| 54 |
|
| 55 |
+
amenities_proximity = st.selectbox("Proximity to Amenities", ["Walking distance", "A short drive away", "I don't mind being far from amenities"])
|
| 56 |
+
additional_details = st.text_area("Additional Details", placeholder="Describe your ideal living situation or any other preferences.")
|
| 57 |
+
|
| 58 |
submit_button = st.button('Find Neighborhood')
|
| 59 |
|
| 60 |
with col2:
|
| 61 |
# Placeholder for the result
|
| 62 |
+
st.subheader("Recommended Neighborhoods")
|
| 63 |
result_placeholder = st.empty()
|
| 64 |
if submit_button:
|
| 65 |
messages = initial_messages.copy()
|
| 66 |
reply, _ = CustomChatGPT(additional_details, amenities_proximity, amenities, messages)
|
|
|
|
| 67 |
result_placeholder.write(reply)
|
| 68 |
else:
|
| 69 |
+
result_placeholder.write("**Results will appear here after you submit your preferences**")
|