🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
bug fix
Steven Lee95391ca32d2a
diff --git a/README.md b/README.mdindex 5faf5d9de..5e67483d6 100644--- a/README.md+++ b/README.md@@ -93,7 +93,7 @@ python setup.py install- **Install the Required Browsers**- to support PDF conversion, had better install Chrominum.+ to support PDF conversion, please install Chrominum.```bashplaywright install --with-deps chromium@@ -114,16 +114,18 @@ python setup.py installpip install pyppeteer```- - **Install the Required Browsers**+ - **Use your own Browsers**+ pyppeteer alow you use installed browsers, please set the following envirment+```bash- pyppeteer-install+ export PUPPETEER_EXECUTABLE_PATH = /path/to/your/chromium or edge or chrome```- pyppeteer alow you use already installed browsers, if you do not want to run the above command, please set the following envirment-+ please do not use this command to install browser, it is too old+```bash- export PUPPETEER_EXECUTABLE_PATH = /path/to/your/chromium or edge or chrome+ pyppeteer-install```- **modify `config.yaml`**diff --git a/metagpt/utils/common.py b/metagpt/utils/common.pyindex 99038dc64..5f94de066 100644--- a/metagpt/utils/common.py+++ b/metagpt/utils/common.py@@ -192,6 +192,7 @@ class CodeParser:logger.error(f"{pattern} not match following text:")logger.error(text)# raise Exception+ return ""return code@classmethoddiff --git a/metagpt/utils/mmdc_pyppeteer.py b/metagpt/utils/mmdc_pyppeteer.pyindex e6986bc76..f3e00d053 100644--- a/metagpt/utils/mmdc_pyppeteer.py+++ b/metagpt/utils/mmdc_pyppeteer.py@@ -34,10 +34,15 @@ def mermaid_to_file(mermaid_code, output_file_without_suffix, width, height):async def mermaid_to_file0(mermaid_code, output_file_without_suffix, width=2048, height=2048, suffixes=['png', 'svg', 'pdf'])-> int:__dirname = os.path.dirname(os.path.abspath(__file__))- browser = await launch(headless=True,- executablePath=os.getenv('PUPPETEER_EXECUTABLE_PATH',"/opt/homebrew/bin/chromium"),- args=['--disable-extensions',"--no-sandbox"]- )+ executablePath = os.getenv('PUPPETEER_EXECUTABLE_PATH',"")+ if executablePath:+ browser = await launch(headless=True,+ executablePath=executablePath,+ args=['--disable-extensions',"--no-sandbox"]+ )+ else:+ print("Please set the environment variable:PUPPETEER_EXECUTABLE_PATH.")+ return -1page = await browser.newPage()device_scale_factor = 1.0