Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,12 @@ class EvalRequest(BaseModel):
|
|
| 15 |
task_description: str
|
| 16 |
python_code: str
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
@app.post("/evaluate")
|
| 19 |
async def evaluate_code(request: EvalRequest):
|
| 20 |
prompt = f"Task Description:\n{request.task_description}\n\nSubmitted Code:\n{request.python_code}\n\nEvaluate the code against the task. Assign a final score out of 10. Keep your feedback concise and helpful."
|
|
|
|
| 15 |
task_description: str
|
| 16 |
python_code: str
|
| 17 |
|
| 18 |
+
# --- ADDED HEALTH CHECK ROUTE HERE ---
|
| 19 |
+
@app.get("/")
|
| 20 |
+
async def health_check():
|
| 21 |
+
return {"status": "Online", "message": "AI Code Evaluator is running! Send POST requests to /evaluate"}
|
| 22 |
+
# -------------------------------------
|
| 23 |
+
|
| 24 |
@app.post("/evaluate")
|
| 25 |
async def evaluate_code(request: EvalRequest):
|
| 26 |
prompt = f"Task Description:\n{request.task_description}\n\nSubmitted Code:\n{request.python_code}\n\nEvaluate the code against the task. Assign a final score out of 10. Keep your feedback concise and helpful."
|