taratrankennedy commited on
Commit
494d4f4
·
verified ·
1 Parent(s): b50d55b

Update app.py to include Pinterest links

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -87,14 +87,32 @@ def query_model(question):
87
  """
88
  Process a question, find relevant information, and generate a response.
89
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  if question == "":
91
  return "Welcome to Designare! Ask me anything about different styles or inspiration for interior design."
 
92
  relevant_segment = find_relevant_segment(question, segments)
93
  if not relevant_segment:
94
  return "Could not find specific information. Please refine your question."
 
95
  response = generate_response(question, relevant_segment)
96
  return response
97
 
 
 
 
98
  # Define the welcome message and specific topics the chatbot can provide information about
99
  welcome_message = """
100
  # 🛋️ Welcome to Designare!
 
87
  """
88
  Process a question, find relevant information, and generate a response.
89
  """
90
+
91
+ keyword_links = {
92
+ "temporary": "https://www.pinterest.com/example/temporary-interior-design/",
93
+ "budget": "https://www.pinterest.com/example/budget-interior-design/",
94
+ "modern": "https://www.pinterest.com/example/modern-interior-design/",
95
+ "rustic": "https://www.pinterest.com/example/rustic-interior-design/",
96
+ "bohemian": "https://www.pinterest.com/example/bohemian-interior-design/"
97
+ }
98
+
99
+ for keyword, link in keyword_links.items():
100
+ if keyword in question.lower():
101
+ return link
102
+
103
  if question == "":
104
  return "Welcome to Designare! Ask me anything about different styles or inspiration for interior design."
105
+
106
  relevant_segment = find_relevant_segment(question, segments)
107
  if not relevant_segment:
108
  return "Could not find specific information. Please refine your question."
109
+
110
  response = generate_response(question, relevant_segment)
111
  return response
112
 
113
+
114
+
115
+
116
  # Define the welcome message and specific topics the chatbot can provide information about
117
  welcome_message = """
118
  # 🛋️ Welcome to Designare!