feat: add error_details to batch evaluation response
- Shows first 10 errors with activity_id, training_type_id, and error message - Helps debug evaluation failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
41c7084159
commit
33e27a4f3e
|
|
@ -228,6 +228,9 @@ def batch_evaluate_activities(
|
|||
"errors": 0
|
||||
}
|
||||
|
||||
# Track error details
|
||||
error_details = []
|
||||
|
||||
for activity in activities:
|
||||
activity_dict = dict(activity)
|
||||
try:
|
||||
|
|
@ -246,7 +249,16 @@ def batch_evaluate_activities(
|
|||
|
||||
except Exception as e:
|
||||
logger.error(f"[BATCH-EVAL] Error evaluating {activity_dict['id']}: {e}")
|
||||
error_details.append({
|
||||
"activity_id": activity_dict['id'],
|
||||
"training_type_id": activity_dict.get('training_type_id'),
|
||||
"error": str(e)
|
||||
})
|
||||
stats["errors"] += 1
|
||||
|
||||
# Add error details to stats (limit to first 10)
|
||||
if error_details:
|
||||
stats["error_details"] = error_details[:10]
|
||||
|
||||
logger.info(f"[BATCH-EVAL] Completed: {stats}")
|
||||
return stats
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user