mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Merge pull request #1338 from Stitch-z/main
fix: 修复父类role代码改动而影响到子类role-教程助手功能的问题
This commit is contained in:
commit
38cea1daf2
1 changed files with 4 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ class TutorialAssistant(Role):
|
|||
self.main_title = titles.get("title")
|
||||
directory = f"{self.main_title}\n"
|
||||
self.total_content += f"# {self.main_title}"
|
||||
actions = list()
|
||||
actions = list(self.actions)
|
||||
for first_dir in titles.get("directory"):
|
||||
actions.append(WriteContent(language=self.language, directory=first_dir))
|
||||
key = list(first_dir.keys())[0]
|
||||
|
|
@ -64,6 +64,8 @@ class TutorialAssistant(Role):
|
|||
for second_dir in first_dir[key]:
|
||||
directory += f" - {second_dir}\n"
|
||||
self.set_actions(actions)
|
||||
self.rc.max_react_loop = len(self.actions)
|
||||
return Message()
|
||||
|
||||
async def _act(self) -> Message:
|
||||
"""Perform an action as determined by the role.
|
||||
|
|
@ -77,8 +79,7 @@ class TutorialAssistant(Role):
|
|||
self.topic = msg.content
|
||||
resp = await todo.run(topic=self.topic)
|
||||
logger.info(resp)
|
||||
await self._handle_directory(resp)
|
||||
return await super().react()
|
||||
return await self._handle_directory(resp)
|
||||
resp = await todo.run(topic=self.topic)
|
||||
logger.info(resp)
|
||||
if self.total_content != "":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue