MCPcopy
hub / github.com/stanford-oval/storm / post_run

Method post_run

knowledge_storm/storm_wiki/engine.py:290–310  ·  view source on GitHub ↗

Post-run operations, including: 1. Dumping the run configuration. 2. Dumping the LLM call history.

(self)

Source from the content-addressed store, hash-verified

288 return polished_article
289
290 def post_run(self):
291 """
292 Post-run operations, including:
293 1. Dumping the run configuration.
294 2. Dumping the LLM call history.
295 """
296 config_log = self.lm_configs.log()
297 FileIOHelper.dump_json(
298 config_log, os.path.join(self.article_output_dir, "run_config.json")
299 )
300
301 llm_call_history = self.lm_configs.collect_and_reset_lm_history()
302 with open(
303 os.path.join(self.article_output_dir, "llm_call_history.jsonl"), "w"
304 ) as f:
305 for call in llm_call_history:
306 if "kwargs" in call:
307 call.pop(
308 "kwargs"
309 ) # All kwargs are dumped together to run_config.json.
310 f.write(json.dumps(call) + "\n")
311
312 def _load_information_table_from_local_fs(self, information_table_local_path):
313 assert os.path.exists(information_table_local_path), makeStringRed(

Callers 11

mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
handle_final_writingFunction · 0.80

Calls 3

dump_jsonMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected