Food Manufacturing · Quality Assurance Specialists
Screen Ingredient Spec Sheets for Allergen Disclosures
Incoming raw material specification sheets often describe cross-contact risks, processing aids, and facility disclosures in unstructured supplier text. Quality assurance specialists need to triage these statements before materials enter production inventory. This example helps your intake workflow decide whether a supplier specification states clear allergen presence, explicit allergen freedom, ambiguous trace warnings, or incomplete disclosures.
Updated · Examples verified with jev-1.13.0
The problem
The input provides supplier-submitted ingredient compositions, processing aid descriptions, and facility handling statements. Suppliers use varied phrasing for cross-contact risks, making basic keyword searches prone to confusing trace warnings with active ingredients or omitting unmentioned allergens entirely. The application must classify the text disclosure so downstream services can route ambiguous or incomplete records to specialists for review before intake. This text-based triage evaluates only what the supplier documented; it does not replace independent laboratory testing or authoritative verification of facility sanitation.
How TypeSafe helps
The application supplies raw material specifications containing composition, processing aids, and facility handling notes to evaluate the allergen_triage choice question. In the observed examples, the API returned ambiguous_trace_warning for shared equipment warnings, allergen_free_declared for explicit statements of dedicated allergen-free facilities, and missing_disclosure when facility notes were blank. The API only provides this classification judgment, leaving policy enforcement and execution entirely to your downstream application code. Downstream logic can use these labels to route ambiguous warnings to QA specialists for audit, request updated documents from suppliers on missing disclosures, and hold materials until separate intake verifications are completed.
- Input
- A JSON object containing the supplier ingredient notes, facility handling notes, and stated composition.
- Decision
- Choice: Classify the ingredient profile into allergen-free-declared, allergen-present-declared, ambiguous-trace-warning, or missing-disclosure.
- Next action
- Downstream code marks the batch profile for immediate warehouse release, routes it to an allergen specialist for audit, or returns the form to the supplier requesting missing documentation.
Three verified examples
These responses were returned during a previous API verification. New probabilities can differ.
Shared equipment cautionary trace warning (primary)
Expected behavior: The specification states that oat flour is milled on shared equipment with wheat and soy and notes possible trace cross-contact, which matches the ambiguous trace warning classification.
Input
{
"ingredient_name": "Organic Oat Flour",
"composition": "100% milled whole oats",
"processing_aids": "None",
"facility_notes": "Milled on shared equipment with wheat and soy. May contain trace amounts of gluten and soy."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"answers": {
"allergen_triage": {
"type": "choice",
"choice": "ambiguous_trace_warning",
"probabilities": {
"allergen_free_declared": 0,
"allergen_present_declared": 0,
"ambiguous_trace_warning": 1,
"missing_disclosure": 0
},
"confidence": 1
}
},
"usage": {
"input_tokens": 492,
"output_tokens": 70
}
}Dedicated allergen-free facility statement (alternative)
Expected behavior: The specification explicitly affirms production in a dedicated facility free from common allergens without shared equipment, matching the allergen-free declared classification.
Input
{
"ingredient_name": "Organic Tapioca Starch",
"composition": "100% manioc root starch",
"processing_aids": "None",
"facility_notes": "Produced in a dedicated allergen-free facility with verified separation from top-9 allergens and zero shared equipment."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"answers": {
"allergen_triage": {
"type": "choice",
"choice": "allergen_free_declared",
"probabilities": {
"allergen_present_declared": 0,
"ambiguous_trace_warning": 0,
"allergen_free_declared": 1,
"missing_disclosure": 0
},
"confidence": 1
}
},
"usage": {
"input_tokens": 497,
"output_tokens": 71
}
}Blank facility notes omitting allergen disclosure (edge case)
Expected behavior: The facility notes field is an empty string and the specification provides no allergen statement, matching the missing disclosure classification.
Input
{
"ingredient_name": "Cane Sugar Granules",
"composition": "100% sucrose derived from sugar cane",
"processing_aids": "Calcium hydroxide used in clarification",
"facility_notes": ""
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"answers": {
"allergen_triage": {
"type": "choice",
"choice": "missing_disclosure",
"probabilities": {
"missing_disclosure": 1,
"allergen_free_declared": 0,
"ambiguous_trace_warning": 0,
"allergen_present_declared": 0
},
"confidence": 1
}
},
"usage": {
"input_tokens": 481,
"output_tokens": 69
}
}Try online
Start with a verified example, edit the request, then ask Jev. A live request is sent only when you press Try online.
Expected behavior: The specification states that oat flour is milled on shared equipment with wheat and soy and notes possible trace cross-contact, which matches the ambiguous trace warning classification.
Use non-sensitive test data. Live input goes to typesafe.pro and TypeSafe. Anonymous requests use the gateway’s free rate limit.
The best-fitting label
Probabilities compare your labels. Confidence describes how decisive the model is, not whether it is correct.
import jsonfrom urllib.error import HTTPError, URLErrorfrom urllib.request import Request, urlopenBASE_URL = "https://api.typesafe.pro"payload = { "model": "jev-latest", "state": { "ingredient_name": "Organic Oat Flour", "composition": "100% milled whole oats", "processing_aids": "None", "facility_notes": "Milled on shared equipment with wheat and soy. May contain trace amounts of gluten and soy.", }, "questions": { "allergen_triage": { "type": "choice", "instructions": "Review the raw material specification in state and classify its allergen disclosure status.", "criteria": { "allergen_free_declared": "Explicitly declares the ingredient is free of common allergens and processed on dedicated allergen-free equipment.", "allergen_present_declared": "Explicitly lists one or more common allergens as intentional ingredients or components.", "ambiguous_trace_warning": "Contains cautionary trace warnings, shared equipment notices, or cross-contact disclaimers.", "missing_disclosure": "Omits allergen statements, leaves facility notes blank, or lacks substantive allergen information.", }, }, },}request = Request( f"{BASE_URL}/v1/systemone", data=json.dumps(payload).encode("utf-8"), headers={"Content-Type": "application/json"}, method="POST",)try: with urlopen(request, timeout=20) as response: result = json.load(response)except HTTPError as error: raise SystemExit(f"API returned HTTP {error.code}") from errorexcept URLError as error: raise SystemExit(f"Connection failed: {error.reason}") from errorprint(json.dumps(result["answers"], indent=2))Limitations and review
- Classifying a sheet as allergen_free_declared evaluates only the supplier's self-reported text; it does not confirm facility sanitation, test reports, or regulatory compliance. You can use these triage labels to direct records to the right review queue, but staff or external systems still need to perform independent authoritative checks before granting production approval.
- The demonstrated allergen_triage question uses a single Choice primitive that returns only one overall category per evaluation. While this single question does not output a per-allergen breakdown, you can implement separate questions or multi-label workflows if you need to detect distinct individual allergens across the text.
- Observed responses and probabilities reflect specific historical runs and are not guaranteed outputs for all supplier phrasing. You can set confidence thresholds in your downstream code to flag border cases or unexpected phrasing for human QA inspection.
Set thresholds against your own examples before relying on an automated decision.