fix: Include contents of purpose field when parsing ingredients (#6494)

This commit is contained in:
Tom Strange
2025-11-03 18:09:00 +00:00
committed by GitHub
parent 14e87918fb
commit 3d177566ed

View File

@@ -133,6 +133,9 @@ class NLPParser(ABCIngredientParser):
if ingredient.comment:
note_parts.append(ingredient.comment.text)
confidences.append(ingredient.comment.confidence)
if ingredient.purpose:
note_parts.append(ingredient.purpose.text)
confidences.append(ingredient.purpose.confidence)
# average confidence among all note parts
confidence = sum(confidences) / len(confidences) if confidences else 0