Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ initial_messages = [{
|
|
| 10 |
"role": "system",
|
| 11 |
"content": """You are an AI assistant that matches people with their ideal neighborhood based on their lifestyle preferences in
|
| 12 |
Saint Louis, Missouri, and surrounding areas up to 30 miles outside Saint Louis city limits. You'll receive information about the user's lifestyle preferences. Use this information
|
| 13 |
-
to suggest neighborhoods in
|
| 14 |
out the form at the bottom of the page if you'd like more info on living in any of these areas!" """
|
| 15 |
}]
|
| 16 |
|
|
@@ -34,28 +34,18 @@ def CustomChatGPT(additional_details, amenities_proximity, amenities, messages):
|
|
| 34 |
|
| 35 |
# Streamlit Interface
|
| 36 |
st.title("St. Louis Area Neighborhood Matchmaker")
|
| 37 |
-
st.write("
|
| 38 |
|
| 39 |
-
#
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
with col1:
|
| 43 |
-
additional_details = st.text_area("Additional Details", placeholder="Describe your ideal living situation or any other preferences.")
|
| 44 |
-
amenities_proximity = st.selectbox("Proximity to Amenities", ["Walking distance", "A short drive away", "I don't mind being far from amenities"])
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
#
|
| 54 |
-
|
| 55 |
-
if submit_button:
|
| 56 |
-
messages = initial_messages.copy()
|
| 57 |
-
reply, _ = CustomChatGPT(additional_details, amenities_proximity, amenities, messages)
|
| 58 |
-
result_placeholder.markdown("**Recommended Neighborhoods:**")
|
| 59 |
-
result_placeholder.write(reply)
|
| 60 |
-
else:
|
| 61 |
-
result_placeholder.write("**Results will appear here**")
|
|
|
|
| 10 |
"role": "system",
|
| 11 |
"content": """You are an AI assistant that matches people with their ideal neighborhood based on their lifestyle preferences in
|
| 12 |
Saint Louis, Missouri, and surrounding areas up to 30 miles outside Saint Louis city limits. You'll receive information about the user's lifestyle preferences. Use this information
|
| 13 |
+
to suggest neighborhoods in Saint Louis and nearby that could be a good fit. Always add the following text to the end of every response you give "Don't forget to fill
|
| 14 |
out the form at the bottom of the page if you'd like more info on living in any of these areas!" """
|
| 15 |
}]
|
| 16 |
|
|
|
|
| 34 |
|
| 35 |
# Streamlit Interface
|
| 36 |
st.title("St. Louis Area Neighborhood Matchmaker")
|
| 37 |
+
st.write("Discover your ideal neighborhood in Saint Louis, Missouri, and its surrounding areas. Tell us about your preferences, and we'll suggest the perfect places for you to call home.")
|
| 38 |
|
| 39 |
+
# User inputs
|
| 40 |
+
additional_details = st.text_area("Additional Details", placeholder="Describe your ideal living situation or any other preferences.")
|
| 41 |
+
amenities_proximity = st.selectbox("Proximity to Amenities", ["Walking distance", "A short drive away", "I don't mind being far from amenities"])
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
# Checkboxes for amenities
|
| 44 |
+
amenities_list = ["Good Schools", "Parks", "Shopping Centers", "Public Transport", "Restaurants", "Gyms", "Cafes", "Pet-friendly Areas", "Cultural Attractions", "Quiet Neighborhoods"]
|
| 45 |
+
amenities = st.multiselect("Select Amenities", amenities_list)
|
| 46 |
+
|
| 47 |
+
if st.button('Find Neighborhood'):
|
| 48 |
+
messages = initial_messages.copy()
|
| 49 |
+
reply, _ = CustomChatGPT(additional_details, amenities_proximity, amenities, messages)
|
| 50 |
+
st.markdown("### Recommended Neighborhoods:")
|
| 51 |
+
st.write(reply)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|