MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / _load_from_task_values

Function _load_from_task_values

gdpval_bench/task_loader.py:298–324  ·  view source on GitHub ↗

Load from ClawWork task_values.jsonl (summary only, no full prompt).

(tv_path: Path)

Source from the content-addressed store, hash-verified

296
297
298def _load_from_task_values(tv_path: Path) -> List[Dict[str, Any]]:
299 """Load from ClawWork task_values.jsonl (summary only, no full prompt)."""
300 tasks = []
301 with open(tv_path, "r", encoding="utf-8") as f:
302 for line in f:
303 line = line.strip()
304 if not line:
305 continue
306 try:
307 rec = json.loads(line)
308 except json.JSONDecodeError:
309 continue
310
311 task = {
312 "task_id": rec.get("task_id", ""),
313 "occupation": rec.get("occupation", ""),
314 "sector": rec.get("sector", ""),
315 "prompt": rec.get("task_summary", ""),
316 "reference_files": [],
317 "task_value_usd": rec.get("task_value_usd", 0.0),
318 "hourly_wage": rec.get("hourly_wage", 0.0),
319 "hours_estimate": rec.get("hours_estimate", 0.0),
320 }
321 tasks.append(task)
322
323 print(f" [task_values.jsonl] {len(tasks)} tasks loaded from {tv_path}")
324 return tasks
325
326
327# ═══════════════════════════════════════════════════════════════════

Callers 1

load_tasksFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected