Skip to content

Commit 6764677

Browse files
committed
chore: minor changes for bmsce hackathon
1 parent 4075779 commit 6764677

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

instructions/lumi_instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You are Lumi, an intelligent product nutrient analyzer. Your role is to categori
3636

3737
3. **Health Risk Identification**:
3838
- If the product data contains an `ingredients` key, analyze the ingredients for potential health risks.
39-
- Identify potential health risks based on the user's health profile, including medical conditions and allergies.
39+
- Identify potential health risks based on the user's health profile, including allergies and medical conditions.
4040
- Provide the output as a Python list of possible high-risk issues under **ingredient_warnings**, with concise and specific reasoning.
4141
- Skip nutrient categorization if the `ingredients` key is the **only** key present, and do not proceed to step 2.
4242

metadata/food_categories.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464
],
6565
"Nuts": ["Cashew Nuts"],
6666
"Oil": ["Cotton Seed Oil", "Hydrogenated Vegetable Oil", "Rapeseed Oil"],
67-
"Palm-Oil": ["Edible Palm Vegetable Oil", "Edible Vegetable Oil", "Vegetable Oil Palm Oil"],
67+
"Palm-Oil": [
68+
"Edible Palm Vegetable Oil",
69+
"Edible Vegetable Oil",
70+
"Vegetable Oil Palm Oil"
71+
],
6872
"Protein": ["Proteins"],
6973
"Rice": ["Rice Meal"],
7074
"Salt": [

server/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def runtime_error(function_name: str, error_message: str, **kwargs) -> None:
113113

114114
print(f'[Database] Error logged for "{function_name}": {error_message}')
115115
except Exception as exc:
116-
runtime_error('runtime_error', str(exc), function_name=function_name, error_message=error_message, **kwargs)
116+
runtime_error('runtime_error', str(exc), function_name=function_name, error_message=error_message)
117117
return {'error': 'Firestore storage error: ' + str(exc)}, 500
118118

119119
def register_user_profile(email: str, password: str) -> None:

server/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def __init__(self, age: int = None, gender: str = None, height: float = None,
3737
self.height = height
3838
self.weight = weight
3939
self.body_mass_index = body_mass_index or calculate_bmi(weight, height)
40-
self.dietary_preferences = dietary_preferences or []
4140
self.allergies = allergies or []
41+
self.dietary_preferences = dietary_preferences or []
4242
self.medical_conditions = medical_conditions or []
4343

4444
def to_dict(self) -> dict:
@@ -48,8 +48,8 @@ def to_dict(self) -> dict:
4848
'height': self.height,
4949
'weight': self.weight,
5050
'body_mass_index': self.body_mass_index,
51-
'dietary_preferences': self.dietary_preferences,
5251
'allergies': self.allergies,
52+
'dietary_preferences': self.dietary_preferences,
5353
'medical_conditions': self.medical_conditions
5454
}
5555

server/user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ def update_profile() -> Response:
5353
update_data['health_profile.height'] = height
5454
if (weight := request.json.get('weight')) not in [None, '']:
5555
update_data['health_profile.weight'] = weight
56-
if (dietary_preferences := request.json.get('dietary_preferences')) not in [None, '']:
57-
update_data['health_profile.dietary_preferences'] = dietary_preferences
5856
if (allergies := request.json.get('allergies')) not in [None, '']:
5957
update_data['health_profile.allergies'] = allergies
58+
if (dietary_preferences := request.json.get('dietary_preferences')) not in [None, '']:
59+
update_data['health_profile.dietary_preferences'] = dietary_preferences
6060
if (medical_conditions := request.json.get('medical_conditions')) not in [None, '']:
6161
update_data['health_profile.medical_conditions'] = medical_conditions
6262

@@ -88,8 +88,8 @@ def health_profile() -> Response:
8888
gender=request.json.get('gender'),
8989
height=request.json.get('height'),
9090
weight=request.json.get('weight'),
91-
dietary_preferences=request.json.get('dietary_preferences'),
9291
allergies=request.json.get('allergies'),
92+
dietary_preferences=request.json.get('dietary_preferences'),
9393
medical_conditions=request.json.get('medical_conditions')
9494
)
9595

0 commit comments

Comments
 (0)