Preetham Jain M commited on
Commit
70f6e11
·
1 Parent(s): ca537d4

Expand environment with Level 4 (Extreme) and Level 5 (Chaos) tasks

Browse files
Files changed (3) hide show
  1. inference.py +2 -2
  2. openenv.yaml +6 -0
  3. tasks.py +49 -0
inference.py CHANGED
@@ -28,8 +28,8 @@ OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", HF_TOKEN)
28
 
29
  TASK_NAME = "json_repair_all_tasks"
30
  BENCHMARK = "json-repair-env"
31
- MAX_STEPS = 3
32
- MAX_TOTAL_REWARD = 3.0
33
  SUCCESS_SCORE_THRESHOLD = 0.7
34
 
35
 
 
28
 
29
  TASK_NAME = "json_repair_all_tasks"
30
  BENCHMARK = "json-repair-env"
31
+ MAX_STEPS = 5
32
+ MAX_TOTAL_REWARD = 5.0
33
  SUCCESS_SCORE_THRESHOLD = 0.7
34
 
35
 
openenv.yaml CHANGED
@@ -17,6 +17,12 @@ tasks:
17
  - name: hard_nested_reconstruction
18
  difficulty: hard
19
  description: Reconstruct heavily corrupted nested JSON structure
 
 
 
 
 
 
20
  action_space:
21
  type: object
22
  properties:
 
17
  - name: hard_nested_reconstruction
18
  difficulty: hard
19
  description: Reconstruct heavily corrupted nested JSON structure
20
+ - name: extreme_multilevel_repair
21
+ difficulty: extreme
22
+ description: Fix deeply nested JSON with broken arrays and missing values
23
+ - name: chaos_malformed_object
24
+ difficulty: chaos
25
+ description: Repair a chaotic object with mismatched brackets and damage
26
  action_space:
27
  type: object
28
  properties:
tasks.py CHANGED
@@ -58,5 +58,54 @@ TASKS = [
58
  }
59
  },
60
  "hint": "Quote all keys, fix price to number, add available field, normalize ram to uppercase, keep storage as number"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
  ]
 
58
  }
59
  },
60
  "hint": "Quote all keys, fix price to number, add available field, normalize ram to uppercase, keep storage as number"
61
+ },
62
+ {
63
+ "name": "extreme_multilevel_repair",
64
+ "difficulty": "extreme",
65
+ "description": "Fix deeply nested JSON with broken arrays, unquoted keys, and missing commas",
66
+ "broken_json": "{'order_id': 1001, customer: { 'id': 'C-123', name: 'John Doe', contact: ['john@example.com', 1234567890 ] }, items: [ { sku: 'IT-01', qty: 2 price: 19.99 } { sku: 'IT-02', qty: 1, price: '45.00'}]",
67
+ "correct_json": '{"order_id": 1001, "customer": {"id": "C-123", "name": "John Doe", "contact": ["john@example.com", "1234567890"]}, "items": [{"sku": "IT-01", "qty": 2, "price": 19.99}, {"sku": "IT-02", "qty": 1, "price": 45.00}]}',
68
+ "schema": {
69
+ "type": "object",
70
+ "required": ["order_id", "customer", "items"],
71
+ "properties": {
72
+ "order_id": {"type": "integer"},
73
+ "customer": {
74
+ "type": "object",
75
+ "required": ["id", "name", "contact"],
76
+ "properties": {
77
+ "id": {"type": "string"},
78
+ "name": {"type": "string"},
79
+ "contact": {"type": "array"}
80
+ }
81
+ },
82
+ "items": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "object",
86
+ "required": ["sku", "qty", "price"]
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "hint": "Fix missing commas in the items array, quote all keys, ensure consistent contact types, and convert item prices to numbers."
92
+ },
93
+ {
94
+ "name": "chaos_malformed_object",
95
+ "difficulty": "chaos",
96
+ "description": "Repair a chaotic object with mismatched brackets, unquoted text, and significant structural damage",
97
+ "broken_json": "{ system_log: version: 2.0, events: [ { timestamp: 1700000000 level: ERROR msg: 'Auth failed' }, type: 'connection', info: { ip: 192.168.1.1, retry: true } status: 'FAIL' ",
98
+ "correct_json": '{"system_log": {"version": "2.0", "events": [{"timestamp": 1700000000, "level": "ERROR", "msg": "Auth failed"}], "type": "connection", "info": {"ip": "192.168.1.1", "retry": true}, "status": "FAIL"}}',
99
+ "schema": {
100
+ "type": "object",
101
+ "required": ["system_log"],
102
+ "properties": {
103
+ "system_log": {
104
+ "type": "object",
105
+ "required": ["version", "events", "type", "info", "status"]
106
+ }
107
+ }
108
+ },
109
+ "hint": "The events array is missing a closing bracket, the system_log structure is flat in the broken version but needs nesting, and multiple delimiters are missing."
110
  }
111
  ]