debug: add detailed logging to get_nutrition_avg
This commit is contained in:
parent
285184ba89
commit
a441537dca
|
|
@ -112,8 +112,10 @@ def get_nutrition_avg(profile_id: str, field: str, days: int = 30) -> str:
|
|||
This function now only FORMATS the data for AI consumption.
|
||||
"""
|
||||
data = get_nutrition_average_data(profile_id, days)
|
||||
print(f"[DEBUG] get_nutrition_average_data returned: {data}")
|
||||
|
||||
if data['confidence'] == 'insufficient':
|
||||
print(f"[DEBUG] Confidence is insufficient, returning 'nicht verfügbar'")
|
||||
return "nicht verfügbar"
|
||||
|
||||
# Map field names to data keys
|
||||
|
|
@ -125,6 +127,7 @@ def get_nutrition_avg(profile_id: str, field: str, days: int = 30) -> str:
|
|||
}
|
||||
data_key = field_map.get(field, f'{field}_avg')
|
||||
value = data.get(data_key, 0)
|
||||
print(f"[DEBUG] field={field}, data_key={data_key}, value={value}")
|
||||
|
||||
if field == 'kcal':
|
||||
return f"{int(value)} kcal/Tag (Ø {days} Tage)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user