MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / rebuild_pptx

Function rebuild_pptx

utils/src/experiment/rebuild.py:20–34  ·  view source on GitHub ↗
(agent_steps: str, prs: Presentation)

Source from the content-addressed store, hash-verified

18
19
20def rebuild_pptx(agent_steps: str, prs: Presentation):
21 slides = []
22 steps = list(jsonlines.open(agent_steps))
23 if len(steps) == 0:
24 os.remove(agent_steps)
25 raise ValueError(f"Jump {agent_steps} as no steps")
26 if steps[-1][0] != HistoryMark.API_CALL_CORRECT:
27 raise ValueError(f"Jump {agent_steps} as last step is failed")
28 for mark, slide_idx, actions in steps:
29 if mark != HistoryMark.API_CALL_CORRECT:
30 continue
31 slides.append(deepcopy(prs.slides[slide_idx - 1])) # slide_idx starts from 1
32 feedback = code_executor.execute_actions(actions, slides[-1])
33 assert feedback is None, feedback
34 return slides
35
36
37def rebuild_all(

Callers 2

rebuild_allFunction · 0.70
rebuild.pyFile · 0.70

Calls 1

execute_actionsMethod · 0.45

Tested by

no test coverage detected