DawnC commited on
Commit
a0a3167
1 Parent(s): 6168863

Update breed_recommendation.py

Browse files
Files changed (1) hide show
  1. breed_recommendation.py +25 -8
breed_recommendation.py CHANGED
@@ -157,17 +157,34 @@ def create_recommendation_tab(UserPreferences, get_breed_recommendations, format
157
  'scores': rec['scores']
158
  } for rec in recommendations]
159
 
160
- # 保存到歷史記錄,也需要更新保存的偏好設定
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  history_component.save_search(
162
  user_preferences={
163
  'living_space': args[0],
164
- 'exercise_time': args[1],
165
- 'grooming_commitment': args[2],
166
- 'experience_level': args[3],
167
- 'has_children': args[4],
168
- 'noise_tolerance': args[5],
169
- 'health_sensitivity': "medium",
170
- 'barking_acceptance': args[5]
 
 
 
171
  },
172
  results=history_results
173
  )
 
157
  'scores': rec['scores']
158
  } for rec in recommendations]
159
 
160
+ # # 保存到歷史記錄,也需要更新保存的偏好設定
161
+ # history_component.save_search(
162
+ # user_preferences={
163
+ # 'living_space': args[0],
164
+ # 'exercise_time': args[1],
165
+ # 'grooming_commitment': args[2],
166
+ # 'experience_level': args[3],
167
+ # 'has_children': args[4],
168
+ # 'noise_tolerance': args[5],
169
+ # 'health_sensitivity': "medium",
170
+ # 'barking_acceptance': args[5]
171
+ # },
172
+ # results=history_results
173
+ # )
174
+
175
  history_component.save_search(
176
  user_preferences={
177
  'living_space': args[0],
178
+ 'yard_access': args[1],
179
+ 'exercise_time': args[2],
180
+ 'exercise_type': args[3],
181
+ 'grooming_commitment': args[4],
182
+ 'experience_level': args[5],
183
+ 'time_availability': args[6],
184
+ 'has_children': args[7],
185
+ 'children_age': args[8] if args[7] else None,
186
+ 'noise_tolerance': args[9],
187
+ 'search_type': 'Criteria' # 標記為條件搜索
188
  },
189
  results=history_results
190
  )