Goal
Generate a product launch blurb with a headline, subheadline, key points, call to action (CTA), and tone, all bounded and validated for direct web publishing.Schema contract
Example input
Example output
Implementation tips
- Tone enum controls voice.
"professional","friendly","technical": the model adopts the specified style without you embedding tone instructions in the prompt. Add or remove values as your brand guidelines evolve. - Length bounds match your layout. The headline is capped at 80 characters (fits a single line on desktop), the subheadline at 140 (fits two lines), and key points at 140 each. These bounds should come from your actual CSS/layout constraints.
- Key points array is bounded.
minItems: 3ensures enough substance for a marketing page.maxItems: 5prevents the model from listing fifteen points that nobody reads. - CTA is required and structured. The
ctaobject guarantees every generated blurb has a clear action. Thepattern: "^https://"onurlprevents relative paths,mailto:links, or other formats your publishing system doesn’t support. - Human review is still needed. The schema handles structure and bounds, but brand voice, factual accuracy, and legal compliance still need human eyes. Schema-constrained output makes this review faster because the structure is predictable.
Related docs
- String bounds: control minLength, maxLength, pattern, and format on text fields
- Bounded arrays: set min/max item counts on key points, bullet lists, etc.
- Enum with fallback: extend tone or category enums with an escape hatch
- String reference | Object reference