Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,13 @@ square_footage = st.selectbox("Square Footage", ["<1000 sqft", "1000-2000 sqft",
|
|
| 16 |
if st.button('Find Property'):
|
| 17 |
# Process the inputs and call the OpenAI API
|
| 18 |
user_input = f"I'm considering buying an investment property in Breckenridge and Blue River, CO. My maximum price is {max_price}. I'm looking for these amenities: {', '.join(amenities)}. Bedrooms: {bedrooms}, Bathrooms: {bathrooms}, Square Footage: {square_footage}."
|
|
|
|
| 19 |
# Call the OpenAI API here with the user_input and get the response
|
| 20 |
-
response =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
| 16 |
if st.button('Find Property'):
|
| 17 |
# Process the inputs and call the OpenAI API
|
| 18 |
user_input = f"I'm considering buying an investment property in Breckenridge and Blue River, CO. My maximum price is {max_price}. I'm looking for these amenities: {', '.join(amenities)}. Bedrooms: {bedrooms}, Bathrooms: {bathrooms}, Square Footage: {square_footage}."
|
| 19 |
+
|
| 20 |
# Call the OpenAI API here with the user_input and get the response
|
| 21 |
+
response = openai.Completion.create(
|
| 22 |
+
engine="text-davinci-003", # Replace with your preferred model
|
| 23 |
+
prompt=user_input,
|
| 24 |
+
max_tokens=150
|
| 25 |
+
)
|
| 26 |
|
| 27 |
+
# Display the response from the API
|
| 28 |
+
st.write(response.choices[0].text.strip())
|