Now, we will use these schemas to infer the type of response from the AI to get type validation in our API route. 4. It sends the immediate response t…