Spaces:
Sleeping
Sleeping
Deploy: server/models.py
Browse files- server/models.py +27 -0
server/models.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel
|
| 2 |
+
from typing import List, Optional, Dict, Any
|
| 3 |
+
|
| 4 |
+
class CodeArenaObservation(BaseModel):
|
| 5 |
+
buggy_code: str
|
| 6 |
+
error_log: str
|
| 7 |
+
test_results: str
|
| 8 |
+
previous_attempts: List[str]
|
| 9 |
+
|
| 10 |
+
class CodeArenaAction(BaseModel):
|
| 11 |
+
proposed_fix: str
|
| 12 |
+
|
| 13 |
+
class TaskInfo(BaseModel):
|
| 14 |
+
task_id: str
|
| 15 |
+
difficulty: str
|
| 16 |
+
description: str
|
| 17 |
+
buggy_code: str
|
| 18 |
+
test_code: str
|
| 19 |
+
optimal_time_seconds: float
|
| 20 |
+
|
| 21 |
+
class ExecutionResult(BaseModel):
|
| 22 |
+
compile_success: bool
|
| 23 |
+
runtime_errors: str
|
| 24 |
+
test_passed: int
|
| 25 |
+
test_total: int
|
| 26 |
+
execution_time_seconds: float
|
| 27 |
+
success: bool
|