task.json
1 { 2 "id": "deploy_medium_001", 3 "domain": "deployment", 4 "difficulty": "MEDIUM", 5 "name": "Fix AI Inference Schema", 6 "description": "The Pydantic model 'InferenceRequest' is failing when the 'confidence' score is a float because it was defined as an 'int'. Fix the type hint.Function must be named 'solution'.", 7 "broken_code": "from pydantic import BaseModel\nfrom typing import List\n\nclass InferenceRequest(BaseModel):\n text: str\n # BROKEN: Should be float\n confidence: int\n\ndef solution(data_dict):\n obj = InferenceRequest(**data_dict)\n return obj.confidence", 8 "baseline_time_ms": 15.0, 9 "baseline_mem_mib": 8.0 10 }