CoolFace
Apppublic

Ferr0/structured-output-playground

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
examples.py34 linesDownload Raw Back to root
1"""Fictional demo texts. Nothing here is real — generic, portfolio-safe."""2 3JOB_TEXT = (4    "We're hiring a Senior Backend Engineer at NimbusForge, a fully-remote team. "5    "You'll design Python services backed by PostgreSQL and ship them on Kubernetes. "6    "Compensation is 75,000–95,000 EUR depending on experience."7)8 9CONTACT_TEXT = (10    "Hi! I'm Dana Okoro, Head of Partnerships at BlueHarbor. "11    "You can reach me at dana.okoro@blueharbor.example or on +33 6 12 34 56 78."12)13 14PRODUCT_TEXT = (15    "The TrailLite X2 is a 1.1 kg ultralight tent in our camping range. "16    "It's priced at 249 USD and currently in stock. Highlights: two-person capacity, "17    "double-wall design, 3-season rating and fully taped seams."18)19 20# Deliberately vague: an int, an enum and a bool all have to be *inferred*. Free-form21# prompting drifts here (a string where an int is required, a value outside the enum);22# constrained decoding forces the schema.23EVENT_TEXT = (24    "Quick sync about the Q3 roadmap, a handful of folks, pretty important, probably over video."25)26 27# [source_text, preset_label, constraints_on]28EXAMPLES = [29    [CONTACT_TEXT, "Contact card", True],30    [PRODUCT_TEXT, "Product", True],31    [EVENT_TEXT, "Event", True],32    [EVENT_TEXT, "Event", False],  # same input, constraints OFF — watch it break the schema33]34