Validate Email Address with Structured Outputs
Let's generate a schema.
Full DIY on the system prompt.
It does generate a code. It does ask for your email.
It knows when the code is wrong
It knows when the code is correct.
So now we need our code which handles the API calls to 1. Route to this structured output until the email has been validated. 2. Get the code and send it to the provided email. 3. Switch to the next (or default) route after the email has been validated.
This is assuming we don't want anyone interacting with our chatbot unless they've provided and validated an email.




