MCPcopy Create free account
hub / github.com/Louisym/MiniCC / save_to_file

Method save_to_file

tutorials/02_session_and_messages.py:244–247  ·  view source on GitHub ↗

保存到 JSON 文件(存档)

(self, path: str)

Source from the content-addressed store, hash-verified

242 }
243
244 def save_to_file(self, path: str) -> None:
245 """保存到 JSON 文件(存档)"""
246 with open(path, "w", encoding="utf-8") as f:
247 json.dump(self.to_dict(), f, ensure_ascii=False, indent=2)
248
249 @classmethod
250 def load_from_file(cls, path: str) -> "Session":

Callers 1

mainFunction · 0.95

Calls 1

to_dictMethod · 0.95

Tested by

no test coverage detected