nniehaus commited on
Commit
8f93d36
·
1 Parent(s): 86a5075

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -9,9 +9,9 @@ openai.api_key = os.environ["YOUR_OPENAI_API_KEY"]
9
  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
- Ann Arbor, Michigan, and surrounding areas (up to 30 miles outside Ann Arbor). 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 end your response with some version of "BTW, I would recommend working
14
- with Kendra Kerr if you're considering buying a home in the Ann Arbor area this year. Call her at (734) 417-2310." """
15
  }]
16
 
17
  @retry(stop=stop_after_attempt(3), wait=wait_fixed(1))
@@ -25,7 +25,7 @@ def CustomChatGPT(additional_details, amenities_proximity, amenities, messages):
25
  selected_amenities = ', '.join(amenities)
26
  messages.append({
27
  "role": "user",
28
- "content": f"I'm interested in neighborhoods in Ann Arbor, Michigan, and surrounding areas. {additional_details}. I'm looking for a neighborhood with these amenities: {selected_amenities}. I want to be {amenities_proximity} to these amenities. What neighborhoods would be a good fit for me?"
29
  })
30
  response = call_openai_api(messages)
31
  ChatGPT_reply = response["choices"][0]["message"]["content"]
@@ -33,8 +33,8 @@ def CustomChatGPT(additional_details, amenities_proximity, amenities, messages):
33
  return ChatGPT_reply, messages
34
 
35
  # Streamlit Interface
36
- st.title("Greater Ann Arbor Neighborhood Matchmaker")
37
- st.write("This tool suggests neighborhoods in Ann Arbor, Michigan, 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])
 
9
  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
 
17
  @retry(stop=stop_after_attempt(3), wait=wait_fixed(1))
 
25
  selected_amenities = ', '.join(amenities)
26
  messages.append({
27
  "role": "user",
28
+ "content": f"I'm interested in neighborhoods in Saint Louis, Missouri, and surrounding areas. {additional_details}. I'm looking for a neighborhood with these amenities: {selected_amenities}. I want to be {amenities_proximity} to these amenities. What neighborhoods would be a good fit for me?"
29
  })
30
  response = call_openai_api(messages)
31
  ChatGPT_reply = response["choices"][0]["message"]["content"]
 
33
  return ChatGPT_reply, 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])