I have no expectation that a string is anything but a string. A string is where the constraints of generating the strict form of the JSON are released so the AI can write whatever it wants until an unescaped double-quote is putting the enforcement back in play.
Consider that the AI produces word-like tokens one at a time. Enforcing generated logits of an email address would be near-impossible - is the token for an “@” symbol going to be forced into the output after “jack”, “jackblack”, “jackblack42”, “jackblack42+” etc.
Here’s a plausible JSON schema, that lets us talk to the AI while it also has been provided the key in question for an email address:
{
"name": "output",
"schema": {
"type": "object",
"properties": {
"response_to_user": {
"type": "string",
"description": "Message to present to the user"
},
"extracted_email": {
"type": "string",
"description": "Email address extracted from user input",
"format": "email"
}
},
"required": [
"response_to_user",
"extracted_email"
],
"additionalProperties": false
},
"strict": true
}
What is placed into AI context for its understanding in addition to the enforcement:
# Response Formats
## output
{"type":"object","properties":{"response_to_user":{"type":"string","description":"Message to present to the user"},"extracted_email":{"type":"string","description":"Email address extracted from user input"}}}
You will see no “format” - just one of many things you can ordinarily write in a draft schema to try to tune up or constrain values of a string or number, that in the subset supported, that at best become a comment, and here, are dropped.
If you were still curious: I told the AI to write “null” as the email and it did, and then a never-ending problem with the Responses API specifically: the output goes into a nonstop loop until max_output_tokens instead of a stop sequence terminating the output.
Or: are they waiting for an @ that will never come and ignoring the quote?
So like my description for email address in the schema, there alone, you’ll have to increase your prompting game so that the AI only produces seen reality and is instructed what is acceptable as a “none” string.
FYI: the same schema does do okay also: