MCPcopy Index your code
hub / github.com/going-doer/Paper2Code / extract_planning

Function extract_planning

codes/utils.py:6–22  ·  view source on GitHub ↗
(trajectories_json_file_path)

Source from the content-addressed store, hash-verified

4from datetime import datetime
5
6def 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

Callers 8

mainFunction · 0.90
3.1_coding_sh.pyFile · 0.90
2_analyzing_llm.pyFile · 0.90
4_debugging.pyFile · 0.90
2_analyzing.pyFile · 0.90
3_coding.pyFile · 0.90
3_coding_llm.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected