INNER CODE UNIT · Python
CategoryPredictionResponseModel
openfoodfacts/openfoodfacts-ai · category-detection/main.py:51
class CategoryPredictionResponseModel(BaseModel):
categories: list[CategoryInfo] = Field(
...,
description="List of categories associated with product. The most precise category should be returned first, then broader categories if possible. "
"Prefer categories in English, unless there there are no good translations in English available. Don't return duplicate categories in different languages. "
"If no category could not be determined, return an empty list.",
)
type: Literal[
"food",
"beauty",
"petfood",
"medication",
"nutrition-supplement",
"household",
"product",
"not-a-product",
] = Field(
...,