Jev for Apple Foundation Models
Swift bridge that turns Apple Foundation Models @Generable schemas into Jev typed questions and reconstructs typed results.
Swift bridge that turns Apple Foundation Models @Generable schemas into Jev typed questions and reconstructs typed results.
The Swift bridge converts an Apple @Generable output schema into Jev questions and reconstructs a typed result. The sample nutrition-label app asks whether a product is safe, scores allergen risk and processing tier, and chooses a primary dietary flag.
Is the product fully compliant with the dietary restriction profile?
The nutrition scanner passes the product label and the user’s dietary restriction profile as the judgment context. Actual label values vary by scan.
Rate allergen and cross-contamination risk.
The nutrition scanner passes the product label and the user’s dietary restriction profile as the judgment context. Actual label values vary by scan.
Classify NOVA processing tier.
The nutrition scanner passes the product label and the user’s dietary restriction profile as the judgment context. Actual label values vary by scan.
Choose the primary dietary conflict or nutritional warning.
The nutrition scanner passes the product label and the user’s dietary restriction profile as the judgment context. Actual label values vary by scan.
The app declares a DietarySafetyDecision @Generable type with Boolean, bounded integers, and a DietaryFlag enum.
The bridge maps constrained schema properties to Noul, Score, and Choice questions and sends the product context.
The bridge decodes Jev answers back into the Swift typed decision for the nutrition scanner.
The bridge makes Jev usable behind Apple Foundation Models’ typed schema interface, while rejecting unbounded strings and carrying schema constraints into the Jev request.