A Menu of Tones: Presets
tone presets
Part of: Tone Rewriter
"Formal" is a vague word. To one model it means stiff legalese; to another, a polite email. If you want consistent results, don't hand the model a bare adjective. Hand it a preset : a named tone with a concrete description of what it means. What a preset is A preset pairs a short name with a precise instruction. Store them in a dict where the name is the key and the guidance is the value: Now "formal" isn't a guess; it's a definition. The preset text drops into your template so the system prompt carries the full description rather than just the label: Why presets beat free-text tones The same preset produces the same style every time, because the model reads the same detailed guidance instead of a lone word it's free to interpret. You also get a menu for free: list(TONE PRESETS) is the set of tones a UI can show without hardcoding them anywhere else. And adding "playful" or "urgent" is one new dict entry, no code change, just data. Looking one up safely Reaching for TONE PRESETS[tone] crashes if the tone isn't there. Use .get with a fallback, or check membership first, so an unknown tone degrades gracefully instead of throwing. You'll build that fallback properly in lesson 6. For n
Challenge: Look Up the Tone