nniehaus commited on
Commit
04a8035
·
1 Parent(s): 8f93d36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -24
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 Ann Arbor 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,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("This tool suggests neighborhoods in Saint Louis, Missouri, and surrounding areas that could be a good fit for you based on your lifestyle preferences.")
38
 
39
- # Using columns to organize the layout
40
- col1, col2 = st.columns([2, 3])
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
- # Checkboxes for amenities
47
- amenities_list = ["Good Schools", "Parks", "Shopping Centers", "Public Transport", "Restaurants", "Gyms"]
48
- amenities = [amenity for amenity in amenities_list if st.checkbox(amenity)]
49
-
50
- submit_button = st.button('Find Neighborhood')
51
-
52
- with col2:
53
- # Placeholder for the result
54
- result_placeholder = st.empty()
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)