alexacuff commited on
Commit
983300a
·
1 Parent(s): bdda117

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -4,12 +4,10 @@ import os
4
 
5
  openai.api_key = os.environ["OPENAI_API_KEY"]
6
 
7
- initial_messages = [{"role": "system", "content": """You are an AI assistant that provides home staging recommendations for real estate agents. You'll receive information about the home for sale and its location. After receiving this information, follow these steps:
8
- 1. Consider the details of the home and its location.
9
- 2. Generate a list of items and strategies to use for staging the home. Think about the target market for the home and what would appeal to potential buyers.
10
- 3. Prioritize items that enhance the home's unique features and downplay any potential negatives.
11
- 4. Recommend items that are easily accessible and cost-effective for the agent.
12
- 5. Reply to the user with a list of recommended items and strategies for staging the home. Include brief explanations for each recommendation."""}]
13
 
14
  def call_openai_api(messages):
15
  return openai.ChatCompletion.create(
@@ -26,19 +24,19 @@ def CustomChatGPT(user_input, messages):
26
 
27
  def wrapped_chat_gpt(home_details, location):
28
  messages = initial_messages.copy()
29
- user_input = f"I have a home for sale with these details: {home_details}. It's located in {location}. How should I stage it for potential buyers?"
30
  reply, updated_messages = CustomChatGPT(user_input, messages)
31
  return reply
32
 
33
  demo = gradio.Interface(
34
  fn=wrapped_chat_gpt,
35
  inputs=[
36
- gradio.inputs.Textbox(label="Home Details", placeholder="Describe the home's features, size, style, etc."),
37
- gradio.inputs.Textbox(label="Location", placeholder="Enter the home's location or neighborhood."),
38
  ],
39
  outputs="text",
40
- title="Home Staging Assistant",
41
- description="This tool provides home staging recommendations for real estate agents. Describe the home's features and its location, and the AI assistant will suggest items and strategies for staging the home to appeal to potential buyers."
42
  )
43
 
44
  demo.launch(inline=False)
 
4
 
5
  openai.api_key = os.environ["OPENAI_API_KEY"]
6
 
7
+ initial_messages = [{
8
+ "role": "system",
9
+ "content": """You are a Home Staging Assistant designed to assist homeowners. Upon receiving details about the home and its location, provide tailored recommendations for staging the property to maximize its appeal to potential buyers. Suggest strategies that emphasize the home's unique features and offer cost-effective solutions."""
10
+ }]
 
 
11
 
12
  def call_openai_api(messages):
13
  return openai.ChatCompletion.create(
 
24
 
25
  def wrapped_chat_gpt(home_details, location):
26
  messages = initial_messages.copy()
27
+ user_input = f"I own a home described as: {home_details}. It's located in {location}. How should I stage it to attract potential buyers?"
28
  reply, updated_messages = CustomChatGPT(user_input, messages)
29
  return reply
30
 
31
  demo = gradio.Interface(
32
  fn=wrapped_chat_gpt,
33
  inputs=[
34
+ gradio.inputs.Textbox(label="Home Details", placeholder="Describe the home: e.g., 3-bedroom Victorian with a backyard."),
35
+ gradio.inputs.Textbox(label="Location", placeholder="Enter the location or neighborhood: e.g., San Francisco's Mission District."),
36
  ],
37
  outputs="text",
38
+ title="Homeowner's Staging Assistant",
39
+ description="This tool offers homeowners AI-driven staging recommendations to make their homes more appealing to potential buyers. Provide your home's features and its location, and receive personalized suggestions."
40
  )
41
 
42
  demo.launch(inline=False)