Skip to content

Commit

Permalink
fix human interact bug & add example
Browse files Browse the repository at this point in the history
  • Loading branch information
garylin2099 committed Feb 20, 2024
1 parent cf344c2 commit a989a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions examples/mi/machine_learning.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import asyncio
import fire

from metagpt.roles.mi.interpreter import Interpreter


async def main(requirement: str):
mi = Interpreter(auto_run=True, use_tools=False)
async def main(auto_run: bool = True):
requirement = "Run data analysis on sklearn Wine recognition dataset, include a plot, and train a model to predict wine class (20% as validation), and show validation accuracy."
mi = Interpreter(auto_run=auto_run)
await mi.run(requirement)


if __name__ == "__main__":
requirement = "Run data analysis on sklearn Wine recognition dataset, include a plot, and train a model to predict wine class (20% as validation), and show validation accuracy."
asyncio.run(main(requirement))
fire.Fire(main)
2 changes: 1 addition & 1 deletion metagpt/strategy/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async def confirm_task(self, task: Task, task_result: TaskResult, review: str):
) # "confirm, ... (more content, such as changing downstream tasks)"
if confirmed_and_more:
self.working_memory.add(Message(content=review, role="user", cause_by=AskReview))
await self.update_plan(review)
await self.update_plan()

def get_useful_memories(self, task_exclude_field=None) -> list[Message]:
"""find useful memories only to reduce context length and improve performance"""
Expand Down

0 comments on commit a989a1a

Please sign in to comment.