Better prompt
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from APIs.aichat import generate
|
from APIs.aichat import generate
|
||||||
|
import shared.config as config
|
||||||
|
|
||||||
|
|
||||||
# 1. Define the output schema as a Pydantic model
|
# 1. Define the output schema as a Pydantic model
|
||||||
@@ -9,10 +10,10 @@ class DishSafetyResult(BaseModel):
|
|||||||
description="True if no microwave hazards presents."
|
description="True if no microwave hazards presents."
|
||||||
)
|
)
|
||||||
warning_message: str = Field(
|
warning_message: str = Field(
|
||||||
description="Short explanation of any hazard found (no more than 50 characters), or an empty string if safe."
|
description=f"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. Only include items that are actually present in the image. If no hazards are detected, this list should be empty."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user