bizvideoschool commited on
Commit
75ef369
1 Parent(s): 50fc87a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -5,7 +5,7 @@ import os
5
  # Ensure your OpenAI API key is set in your environment variables
6
  openai.api_key = os.environ["OPENAI_API_KEY"]
7
 
8
- initial_messages = [{"role": "system", "content": """You are an AI assistant that helps homeowners create a personalized selling plan for their home. You'll receive information about their timeline, budget, and any known tasks they need to complete. Generate a detailed plan that includes a timeline for tasks like repairs, staging, listing, and open houses. Provide advice on how to prioritize tasks based on their budget and timeline."""}]
9
 
10
  def call_openai_api(messages):
11
  return openai.ChatCompletion.create(
@@ -20,16 +20,19 @@ def CustomChatGPT(user_input, messages):
20
  messages.append({"role": "assistant", "content": ChatGPT_reply})
21
  return ChatGPT_reply, messages
22
 
23
- st.title("Personalized Selling Plan Generator")
24
- st.write("This tool generates a personalized selling plan for your home. Enter your selling timeline (in months), your budget for home preparations, and any tasks you already know you need to complete. The AI assistant will provide a detailed plan that includes a timeline for tasks like repairs, staging, listing, and open houses, and advice on how to prioritize tasks based on your budget and timeline.")
25
 
26
- selling_timeline = st.text_input("Selling Timeline", placeholder="Enter the number of months until you plan to sell your home.")
27
- budget = st.text_input("Budget for Preparations", placeholder="Enter the amount of money you have available for home preparations.")
28
- known_tasks = st.text_input("Known Tasks to Complete", placeholder="Enter any tasks you already know you need to complete before selling.")
29
- submit_button = st.button('Generate Plan')
 
 
 
30
 
31
  if submit_button:
32
  messages = initial_messages.copy()
33
- user_input = f"I plan to sell my home in {selling_timeline}. My budget for preparing the home for sale is {budget}. The tasks I know I need to complete are: {known_tasks}."
34
  reply, _ = CustomChatGPT(user_input, messages)
35
  st.write(reply)
 
5
  # Ensure your OpenAI API key is set in your environment variables
6
  openai.api_key = os.environ["OPENAI_API_KEY"]
7
 
8
+ initial_messages = [{"role": "system", "content": """You are an AI assistant that helps users find the perfect engagement ring for their fiance. You'll gather information about their budget, metal preference, carat size, job of the fiance, and whether they prefer a simple or elaborate design. Provide recommendations for engagement rings that match these criteria."""}]
9
 
10
  def call_openai_api(messages):
11
  return openai.ChatCompletion.create(
 
20
  messages.append({"role": "assistant", "content": ChatGPT_reply})
21
  return ChatGPT_reply, messages
22
 
23
+ st.title("Engagement Ring Finder")
24
+ st.write("This tool helps you find the perfect engagement ring for your fiance. Enter your budget, preferred metal, desired carat size, the job of your fiance, and whether you're looking for something simple or elaborate.")
25
 
26
+ budget = st.text_input("Budget", placeholder="Enter your budget for the ring.")
27
+ metal_preference = st.text_input("Metal Preference", placeholder="Enter your preferred metal (e.g., gold, platinum).")
28
+ carat_size = st.text_input("Carat Size", placeholder="Enter the desired carat size.")
29
+ fiance_job = st.text_input("Fiance's Job", placeholder="Enter your fiance's job (e.g., teacher, engineer).")
30
+ design_preference = st.selectbox("Design Preference", ["Simple", "Elaborate"])
31
+
32
+ submit_button = st.button('Find Rings')
33
 
34
  if submit_button:
35
  messages = initial_messages.copy()
36
+ user_input = f"My budget for the engagement ring is {budget}. I prefer {metal_preference} as the metal. I am looking for a ring with a carat size of {carat_size}. My fiance's job is {fiance_job} and I'm looking for a {design_preference.lower()} design."
37
  reply, _ = CustomChatGPT(user_input, messages)
38
  st.write(reply)