Load from ClawWork task_values.jsonl (summary only, no full prompt).
(tv_path: Path)
| 296 | |
| 297 | |
| 298 | def _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 | # ═══════════════════════════════════════════════════════════════════ |