🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
remove:NO_GUI, IS_DOCKER
hy.lie48ecfd9fd22
diff --git a/Dockerfile b/Dockerfileindex 7c13edc50..520d6517d 100644--- a/Dockerfile+++ b/Dockerfile@@ -8,7 +8,7 @@ RUN apt update &&\# Install Mermaid CLI globallyENV CHROME_BIN="/usr/bin/chromium" \- NO_GUI="true"\+ PUPPETEER_CONFIG="/app/metagpt/config/puppeteer-config.json"\PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"RUN npm install -g @mermaid-js/mermaid-cli &&\npm cache clean --forcediff --git a/metagpt/utils/mermaid.py b/metagpt/utils/mermaid.pyindex 406ad00ee..3788b4743 100644--- a/metagpt/utils/mermaid.py+++ b/metagpt/utils/mermaid.py@@ -13,8 +13,6 @@ from metagpt.const import PROJECT_ROOTfrom metagpt.logs import loggerfrom metagpt.utils.common import check_cmd_exists-IS_DOCKER = os.environ.get('NO_GUI', 'false').lower()-def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height=2048) -> int:"""suffix: png/svg/pdf@@ -38,16 +36,13 @@ def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, heightoutput_file = f'{output_file_without_suffix}.{suffix}'# Call the `mmdc` command to convert the Mermaid code to a PNGlogger.info(f"Generating {output_file}..")- if IS_DOCKER == 'true':- subprocess.run(['mmdc', '-p', '/app/metagpt/config/puppeteer-config.json', '-i',- str(tmp), '-o', output_file, '-w', str(width), '-H', str(height)])++ if CONFIG.puppeteer_config:+ subprocess.run([CONFIG.mmdc, '-p', CONFIG.puppeteer_config, '-i', str(tmp), '-o',+ output_file, '-w', str(width), '-H', str(height)])else:- if CONFIG.puppeteer_config:- subprocess.run([CONFIG.mmdc, '-p', CONFIG.puppeteer_config, '-i', str(tmp), '-o',- output_file, '-w', str(width), '-H', str(height)])- else:- subprocess.run([CONFIG.mmdc, '-i', str(tmp), '-o',- output_file, '-w', str(width), '-H', str(height)])+ subprocess.run([CONFIG.mmdc, '-i', str(tmp), '-o',+ output_file, '-w', str(width), '-H', str(height)])return 0