Separate an author from a recipient

Watch short identifiers, spaces and punctuation. · 178 words

Start with a source that labels roles clearly. An email reads: From: Lena Ortiz, lena.ortiz@example.org; To: Sam Rivera; Subject: Museum workshop. Ask: 'Extract the author and recipient. Return JSON with author_name, author_email, recipient_name, and recipient_email. Use only the From and To fields, and use null for any missing email address.' The expected result is {"author_name": "Lena Ortiz", "author_email": "lena.ortiz@example.org", "recipient_name": "Sam Rivera", "recipient_email": null}. It is checkable because every value matches its labeled field, and the author is not chosen just because her name appears first.

Try a source with different wording: 'Written by Priya Shah, Tour Guide; Delivered to Mr. and Mrs. Ellis, 14 Pine Street.' Ask: 'Separate the writer from the addressees. List writer_name and writer_role separately from recipient_names and recipient_address. Do not call a signer the recipient. If a field is absent, write null.' The result is Priya Shah as writer, Tour Guide as role, and 'Mr. and Mrs. Ellis' plus the address as recipient details. Check it against 'Written by' and 'Delivered to.' Role labels are evidence; order of appearance and tone are not.

Check your recall

In the museum email, who is the author, who is the recipient, and which email address belongs to the author?

Check your answer

Lena Ortiz is the author, Sam Rivera is the recipient, and lena.ortiz@example.org belongs to Lena Ortiz because it appears in the From field.

Sources and credits

Original KeyTouch lesson. Background reading · DAIR.AI · Examples of Prompts.