The AI response is configured to have a pre-defined structure, eg.
{
"is_spam": true,
"spam_score": 95,
"reason": "This submission contains multiple indicators of spam, including suspicious email address, fake phone number, inappropriate\/adult content, and excessive URLs\/promotional links. The message is vague and non-contextual, focusing on what the sender can provide rather than a legitimate inquiry.",
"provider": "Claude",
"model": "claude-3-haiku-20240307",
"tokens_used": 830,
"cost": 0.000292,
"response_time": 1.1881251335144043
}
Which we can then use to update the database tracking which enquiries are spam.