From 68250e806991430fd453826ba43d00844880768b Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Sun, 23 Aug 2026 18:30:00 +0200 Subject: [PATCH] IDC --- cloud/safety_checker.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cloud/safety_checker.py b/cloud/safety_checker.py index 0e6e464..55b5aad 100644 --- a/cloud/safety_checker.py +++ b/cloud/safety_checker.py @@ -5,7 +5,7 @@ import shared.config as config class DishSafetyResult(BaseModel): visible_objects: list[str] = Field( - description="List EVERY distinct item visible in the frame (e.g., ['ceramic bowl', 'rice', 'metal spoon handle', 'stew'])." + description="List EVERY distinct item visible in the frame, one item per list element (e.g., ['ceramic bowl', 'rice', 'metal spoon handle', 'stew'])." ) is_safe: bool = Field( description="Is the microwave dish safe to microwave? True if safe, False if unsafe." @@ -22,9 +22,9 @@ def check_dish_safety(image_path: str) -> dict: "You are an expert microwave safety quality inspector analyzing a top-down camera frame.\n\n" "INSPECTION STEPS:\n" "Describe what you see in the image, identify any viewable hazards, and determine if the dish is safe to microwave.\n" - "Alert only if the cooking of the dish **will cause damage** to the microwave or the dish itself.\n" + "Alert only if the cooking of the dish **will cause damage** to the microwave or the dish itself, like metallic objects.\n\n" "NOTES:\n" - "The camera focus is wrongly setup, so the image may be blurry. Please do not take the blurriness or lack of view into a hazardn" + "The camera focus is wrongly setup, so the image may be blurry. Please do not take the blurriness or lack of view into a hazard" ) response_raw = generate( @@ -33,7 +33,8 @@ def check_dish_safety(image_path: str) -> dict: output_format=DishSafetyResult, should_think=False, ) - print(f"[Debug] Raw response from AI generator: {response_raw}") + if config.DEBUG_MESSAGES: + print(f"[Debug] Raw response from AI generator: {response_raw}") if isinstance(response_raw, str): try: