mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
save jupyter file
This commit is contained in:
parent
4634415e37
commit
fd31cc065a
1 changed files with 5 additions and 0 deletions
|
|
@ -156,6 +156,11 @@ class ExecutePyCode(ExecuteCode, Action):
|
|||
|
||||
return code, language
|
||||
|
||||
def save_notebook(self, path: str):
|
||||
path = Path(path)
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
nbformat.write(self.nb, path)
|
||||
|
||||
async def run(self, code: Union[str, Dict, Message], language: str = "python") -> Tuple[str, bool]:
|
||||
code, language = self._process_code(code, language)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue