mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-11 00:32:37 +02:00
bug fix
This commit is contained in:
parent
a3d1c3362f
commit
95391ca32d
3 changed files with 19 additions and 11 deletions
16
README.md
16
README.md
|
|
@ -93,7 +93,7 @@ # Step 3: Clone the repository to your local machine, and install it.
|
|||
|
||||
- **Install the Required Browsers**
|
||||
|
||||
to support PDF conversion, had better install Chrominum.
|
||||
to support PDF conversion, please install Chrominum.
|
||||
|
||||
```bash
|
||||
playwright install --with-deps chromium
|
||||
|
|
@ -114,18 +114,20 @@ # Step 3: Clone the repository to your local machine, and install it.
|
|||
pip install pyppeteer
|
||||
```
|
||||
|
||||
- **Install the Required Browsers**
|
||||
- **Use your own Browsers**
|
||||
|
||||
```bash
|
||||
pyppeteer-install
|
||||
```
|
||||
|
||||
pyppeteer alow you use already installed browsers, if you do not want to run the above command, please set the following envirment
|
||||
pyppeteer alow you use installed browsers, please set the following envirment
|
||||
|
||||
```bash
|
||||
export PUPPETEER_EXECUTABLE_PATH = /path/to/your/chromium or edge or chrome
|
||||
```
|
||||
|
||||
please do not use this command to install browser, it is too old
|
||||
|
||||
```bash
|
||||
pyppeteer-install
|
||||
```
|
||||
|
||||
- **modify `config.yaml`**
|
||||
|
||||
uncomment MERMAID_ENGINE from config.yaml and change it to `pyppeteer`
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ class CodeParser:
|
|||
logger.error(f"{pattern} not match following text:")
|
||||
logger.error(text)
|
||||
# raise Exception
|
||||
return ""
|
||||
return code
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -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 -1
|
||||
page = await browser.newPage()
|
||||
device_scale_factor = 1.0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue