Modified prompt
Build, push image, and notify Watchtower / build-image (push) Successful in 1m12s
Build, push image, and notify Watchtower / notify (push) Successful in 17s

This commit is contained in:
2026-08-11 14:38:35 +02:00
parent f5bea7f636
commit 2572c68ac7
+3 -3
View File
@@ -6,10 +6,10 @@ from APIs.aichat import generate
# 1. Define the output schema as a Pydantic model # 1. Define the output schema as a Pydantic model
class DishSafetyResult(BaseModel): class DishSafetyResult(BaseModel):
is_safe: bool = Field( is_safe: bool = Field(
description="True if no microwave hazards (metal, foil, sealed packaging) are present." description="True if no microwave hazards (metal, foil, sealed packaging, ...) are present."
) )
warning_message: str = Field( warning_message: str = Field(
description="Explanation of any hazard found, or an empty string if safe." description="Short explanation of any hazard found (no more than one sentence), or an empty string if safe."
) )
detected_hazards: list[str] = Field( detected_hazards: list[str] = Field(
description="List of specific hazard items detected." description="List of specific hazard items detected."
@@ -19,7 +19,7 @@ class DishSafetyResult(BaseModel):
def check_dish_safety(image_path: str) -> dict: def check_dish_safety(image_path: str) -> dict:
prompt = ( prompt = (
"Analyze this top-down photo of a dish prepared for microwave cooking. " "Analyze this top-down photo of a dish prepared for microwave cooking. "
"Inspect the area for metal utensils, aluminum foil, metallic dish patterns, or unvented plastic wraps." "Inspect the area for metal utensils, aluminum foil, metallic dish patterns, or unvented plastic wraps that could be dangerous for the cooking process or pose a safety risk."
) )
# 2. Pass the Pydantic class directly to generate() # 2. Pass the Pydantic class directly to generate()