Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 13 |
-
to suggest neighborhoods in Ann Arbor and nearby that could be a good fit. Always
|
| 14 |
-
|
| 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
|
| 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("
|
| 37 |
-
st.write("This tool suggests neighborhoods in
|
| 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])
|