(trajectories_json_file_path)
| 4 | from datetime import datetime |
| 5 | |
| 6 | def extract_planning(trajectories_json_file_path): |
| 7 | with open(trajectories_json_file_path) as f: |
| 8 | traj = json.load(f) |
| 9 | |
| 10 | context_lst = [] |
| 11 | for turn in traj: |
| 12 | if turn['role'] == 'assistant': |
| 13 | # context_lst.append(turn['content']) |
| 14 | content = turn['content'] |
| 15 | if "</think>" in content: |
| 16 | content = content.split("</think>")[-1].strip() |
| 17 | context_lst.append(content) |
| 18 | |
| 19 | |
| 20 | context_lst = context_lst[:3] |
| 21 | |
| 22 | return context_lst |
| 23 | |
| 24 | |
| 25 |
no outgoing calls
no test coverage detected