SELECT title, result.choice AS severity, result.confidence, result.probabilities['blocker'] AS p_blocker
FROM (
SELECT title,
ai_classify(
{'model_name': 'jev'},
{'prompt': 'How severe is this bug report?',
'choice': [{'label': 'blocker', 'description': 'Nobody can use the product'},
{'label': 'major', 'description': 'A core feature is broken, with no workaround'},
{'label': 'minor', 'description': 'Something is wrong, but there is a workaround'},
{'label': 'cosmetic', 'description': 'Only looks wrong'}],
'context_columns': [{'data': title, 'name': 'title'}, {'data': body, 'name': 'body'}]}
) AS result
FROM bug_reports
);