🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
example fix
liuminhui178ddaecb184
diff --git a/examples/android_assistant/run_assistant.py b/examples/android_assistant/run_assistant.pyindex 7d5d4d5c8..dbd1dc6ff 100644--- a/examples/android_assistant/run_assistant.py+++ b/examples/android_assistant/run_assistant.py@@ -9,7 +9,7 @@ from pathlib import Pathimport typer-from metagpt.config2 import config+from metagpt.config2 import Configfrom metagpt.environment.android.android_env import AndroidEnvfrom metagpt.ext.android_assistant.roles.android_assistant import AndroidAssistantfrom metagpt.team import Team@@ -41,6 +41,7 @@ def startup(),device_id: str = typer.Option(default="emulator-5554", help="The Android device_id"),):+ config = Config.default()config.extra = {"stage": stage,"mode": mode,diff --git a/examples/data/di/dog.jpg b/examples/data/di/dog.jpgnew file mode 100644index 000000000..679a932e8Binary files /dev/null and b/examples/data/di/dog.jpg differdiff --git a/examples/data/di/receipt_shopping.jpg b/examples/data/di/receipt_shopping.jpgnew file mode 100644index 000000000..3368eb42fBinary files /dev/null and b/examples/data/di/receipt_shopping.jpg differdiff --git a/examples/data/omniparse/test01.docx b/examples/data/omniparse/test01.docxindex 7b6251799..87b37a8ee 100644Binary files a/examples/data/omniparse/test01.docx and b/examples/data/omniparse/test01.docx differdiff --git a/examples/di/ocr_receipt.py b/examples/di/ocr_receipt.pyindex af54d519b..1755f6490 100644--- a/examples/di/ocr_receipt.py+++ b/examples/di/ocr_receipt.py@@ -1,17 +1,18 @@+from metagpt.const import EXAMPLE_DATA_PATHfrom metagpt.roles.di.data_interpreter import DataInterpreterasync def main():# Notice: pip install metagpt[ocr] before using this example- image_path = "image.jpg"+ image_path = EXAMPLE_DATA_PATH / "di/receipt_shopping.jpg"language = "English"requirement = f"""This is a {language} receipt image.Your goal is to perform OCR on images using PaddleOCR, output text content from the OCR results and discard- coordinates and confidence levels, then recognize the total amount from ocr text content, and finally save as table.+ coordinates and confidence levels, then recognize the total amount from ocr text content, and finally save as csv table.Image path: {image_path}.NOTE: The environments for Paddle and PaddleOCR are all ready and has been fully installed."""- di = DataInterpreter()-+ di = DataInterpreter(react_mode="react")+ print(requirement)await di.run(requirement)diff --git a/examples/di/rm_image_background.py b/examples/di/rm_image_background.pyindex cb7900a0a..e28778241 100644--- a/examples/di/rm_image_background.py+++ b/examples/di/rm_image_background.py@@ -1,5 +1,6 @@import asyncio+from metagpt.const import DEFAULT_WORKSPACE_ROOT, EXAMPLE_DATA_PATHfrom metagpt.roles.di.data_interpreter import DataInterpreter@@ -9,7 +10,7 @@ async def main(requirement: str = ""):if __name__ == "__main__":- image_path = "/your/path/to/the/image.jpeg"- save_path = "/your/intended/save/path/for/image_rm_bg.png"+ image_path = EXAMPLE_DATA_PATH / "di/dog.jpg"+ save_path = DEFAULT_WORKSPACE_ROOT / "image_rm_bg.png"requirement = f"This is a image, you need to use python toolkit rembg to remove the background of the image and save the result. image path:{image_path}; save path:{save_path}."asyncio.run(main(requirement))diff --git a/examples/rag/omniparse.py b/examples/rag/omniparse.pyindex b9159dae5..5295afa00 100644--- a/examples/rag/omniparse.py+++ b/examples/rag/omniparse.py@@ -1,6 +1,6 @@import asyncio-from metagpt.config2 import config+from metagpt.config2 import Configfrom metagpt.const import EXAMPLE_DATA_PATHfrom metagpt.logs import loggerfrom metagpt.rag.parsers import OmniParse@@ -12,6 +12,8 @@ TEST_PDF = EXAMPLE_DATA_PATH / "omniparse/test02.pdf"TEST_VIDEO = EXAMPLE_DATA_PATH / "omniparse/test03.mp4"TEST_AUDIO = EXAMPLE_DATA_PATH / "omniparse/test04.mp3"+config = Config.default()+async def omniparse_client_example():client = OmniParseClient(base_url=config.omniparse.base_url)diff --git a/metagpt/environment/werewolf/env_space.py b/metagpt/environment/werewolf/env_space.pyindex e6243b10f..dd6ceeabe 100644--- a/metagpt/environment/werewolf/env_space.py+++ b/metagpt/environment/werewolf/env_space.py@@ -5,7 +5,7 @@from gymnasium import spacesfrom pydantic import ConfigDict, Field-from metagpt.environment.base_env_space import BaseEnvAction, BaseEnvActionType+from metagpt.base.base_env_space import BaseEnvAction, BaseEnvActionTypefrom metagpt.environment.werewolf.const import STEP_INSTRUCTIONS