Merge pull request #919 from garylin2099/v07-to-main

integrate v0.7 patch updates
This commit is contained in:
Alexander Wu 2024-02-21 15:12:50 +08:00 committed by GitHub
commit b684576e9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 11 additions and 11 deletions

View file

@ -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)

View file

@ -182,7 +182,7 @@ class ExecuteNbCode(Action):
outputs = self.parse_outputs(self.nb.cells[-1].outputs)
outputs, success = truncate(remove_escape_and_color_codes(outputs), is_success=success)
if "!pip" in outputs:
if "!pip" in code:
success = False
return outputs, success

View file

@ -122,7 +122,7 @@ class Planner(BaseModel):
) # "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"""

View file

@ -9,7 +9,6 @@ from __future__ import annotations
import inspect
import os
import re
from collections import defaultdict
import yaml
@ -109,7 +108,8 @@ def register_tool(tool_type: str = "other", schema_path: str = "", **kwargs):
# Get the file path where the function / class is defined and the source code
file_path = inspect.getfile(cls)
if "metagpt" in file_path:
file_path = re.search("metagpt.+", file_path).group(0)
# split to handle ../metagpt/metagpt/tools/... where only metapgt/tools/... is needed
file_path = "metagpt" + file_path.split("metagpt")[-1]
source_code = inspect.getsource(cls)
TOOL_REGISTRY.register_tool(

View file

@ -14,7 +14,7 @@ lancedb==0.4.0
langchain==0.0.352
loguru==0.6.0
meilisearch==0.21.0
numpy>=1.24.3
numpy>=1.24.3,<1.25.0
openai==1.6.0
openpyxl
beautifulsoup4==4.12.2

View file

@ -57,7 +57,7 @@ extras_require["dev"] = (["pylint~=3.0.3", "black~=23.3.0", "isort~=5.12.0", "pr
setup(
name="metagpt",
version="0.7.0",
version="0.7.2",
description="The Multi-Agent Framework",
long_description=long_description,
long_description_content_type="text/markdown",