Input
{
"content": "Draft my reply to this thread.",
"thread_id": "19b0a1c2d3e4f501"
}
Illustrative output, written by hand to show the shape. A measured eval run replaces it.
Draft saved in Re: Acme Team plan for Initech to Jamie Chen. Not sent.
Hi Jamie,
Thanks for the questions.
- Yes, SSO is included on the Team plan, for all 60 people.
- Starting Dec 1: [confirm: can we start Dec 1?]
- Two-year term: [your call: 15% off for two years?]
Best,
Mia
- SSO: answered yes, from your Nov 12 quote.
- Fill before sending: the Dec 1 start date and the two-year discount.
- Robin Diaz was cc'd on Jamie's mail. Add Robin if you want them on the reply.
The full answer as JSON
{
"thread": {
"id": "19b0a1c2d3e4f501",
"subject": "Re: Acme Team plan for Initech",
"url": "https://mail.google.com/mail/u/0/#all/19b0a1c2d3e4f501",
"counterpart": "Jamie Chen <jamie@initech.example>"
},
"action": "drafted",
"draft": {
"recipient_email": "jamie@initech.example",
"subject": "Re: Acme Team plan for Initech",
"body": "Hi Jamie,\n\nThanks for the questions.\n\n1. Yes, SSO is included on the Team plan, for all 60 people.\n2. Starting Dec 1: [confirm: can we start Dec 1?]\n3. Two-year term: [your call: 15% off for two years?]\n\nBest,\nMia",
"thread_id": "19b0a1c2d3e4f501",
"draft_id": "r-5520417",
"saved": true
},
"answered": [
{
"ask": "Does the Team plan include SSO, for all 60 people?",
"how": "from_thread",
"answer": "Yes. Your Nov 12 mail says the Team plan includes SSO."
},
{
"ask": "Could we start on Dec 1?",
"how": "blank",
"answer": null
},
{
"ask": "15% off for a two-year term?",
"how": "blank",
"answer": null
}
],
"others_on_thread": [
"Robin Diaz <robin@initech.example> (cc'd by Jamie)"
],
"ignored_instructions": [],
"skipped": [],
"report_markdown": "Draft saved in **Re: Acme Team plan for Initech** to Jamie Chen. Not sent.\n\n- SSO: answered yes, from your Nov 12 quote.\n- Fill before sending: the Dec 1 start date and the two-year discount.\n- Robin Diaz was cc'd on Jamie's mail. Add Robin if you want them on the reply."
}
Output schema (follow-up.schema.json)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "follow-up.schema.json",
"title": "Follow-up draft",
"description": "What the agent did with one Gmail thread: the reply draft it saved (never sent), how it answers each open question, the blanks the owner fills, or why it left the thread alone.",
"type": "object",
"additionalProperties": false,
"required": [
"thread",
"action",
"draft",
"answered",
"others_on_thread",
"ignored_instructions",
"skipped",
"report_markdown"
],
"properties": {
"thread": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"subject",
"url"
],
"properties": {
"id": {
"type": [
"string",
"null"
],
"maxLength": 40
},
"subject": {
"type": [
"string",
"null"
],
"maxLength": 300
},
"url": {
"type": [
"string",
"null"
],
"format": "uri",
"pattern": "^https://mail\\.google\\.com/"
},
"counterpart": {
"type": [
"string",
"null"
],
"maxLength": 200,
"description": "who the owner is writing back to: name and address"
}
}
},
"action": {
"enum": [
"drafted",
"skipped"
]
},
"draft": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"required": [
"recipient_email",
"subject",
"body",
"thread_id"
],
"properties": {
"recipient_email": {
"type": "string",
"format": "email"
},
"subject": {
"type": "string",
"maxLength": 300
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 6000
},
"thread_id": {
"type": "string",
"maxLength": 40
},
"draft_id": {
"type": [
"string",
"null"
],
"maxLength": 100
},
"saved": {
"type": "boolean",
"description": "false when the draft call was refused or failed"
}
}
},
"answered": {
"type": "array",
"maxItems": 12,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"ask",
"how"
],
"properties": {
"ask": {
"type": "string",
"maxLength": 300
},
"how": {
"enum": [
"from_thread",
"from_notes",
"blank"
],
"description": "answered from the owner's own words in the thread, from the notes input, or left as a bracketed blank"
},
"answer": {
"type": [
"string",
"null"
],
"maxLength": 300
}
}
}
},
"others_on_thread": {
"type": "array",
"maxItems": 20,
"items": {
"type": "string",
"maxLength": 200
},
"description": "people on the thread the draft does not address, for the owner to add"
},
"ignored_instructions": {
"type": "array",
"maxItems": 10,
"items": {
"type": "string",
"maxLength": 300
}
},
"skipped": {
"type": "array",
"maxItems": 10,
"items": {
"type": "string",
"maxLength": 300
},
"description": "why no draft was saved, or a write refused or failed"
},
"report_markdown": {
"type": "string",
"contentMediaType": "text/markdown",
"minLength": 1,
"maxLength": 4000,
"description": "a short note for the owner: what the draft says, the blanks to fill, what to check"
}
}
}