mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 03:46:23 +02:00
fix bug of ExecuteNbCode._init_code was never awaited
This commit is contained in:
parent
a5b94af82f
commit
f2cf8dd74b
2 changed files with 5 additions and 2 deletions
|
|
@ -85,10 +85,12 @@ class ExecuteNbCode(Action):
|
|||
)
|
||||
self.reporter = NotebookReporter()
|
||||
self.set_nb_client()
|
||||
asyncio.run(self._init_code())
|
||||
self._init_called = False
|
||||
|
||||
async def _init_code(self):
|
||||
await self.run(INI_CODE)
|
||||
if not self._init_called:
|
||||
await self.run(INI_CODE)
|
||||
self._init_called = True
|
||||
|
||||
def set_nb_client(self):
|
||||
self.nb_client = RealtimeOutputNotebookClient(
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class DataAnalyst(RoleZero):
|
|||
"""Write a code block for current task and execute it in an interactive notebook environment."""
|
||||
counter = 0
|
||||
success = False
|
||||
await self.execute_code._init_code()
|
||||
|
||||
# plan info
|
||||
plan_status = self.planner.get_plan_status()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue