mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-21 14:05:17 +02:00
Merge pull request #96 from voidking/pr
Move puppeteer-config.json to config directory.
This commit is contained in:
commit
23790619b5
4 changed files with 13 additions and 14 deletions
|
|
@ -67,7 +67,7 @@ # Step 3: Clone the repository to your local machine, and install it.
|
|||
- don't forget to the configuration for mmdc in config.yml
|
||||
|
||||
```yml
|
||||
PUPPETEER_CONFIG: "./puppeteer-config.json"
|
||||
PUPPETEER_CONFIG: "./config/puppeteer-config.json"
|
||||
MMDC: "./node_modules/.bin/mmdc"
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
# The configuration of key.yaml has a higher priority and will not enter git
|
||||
|
||||
#### if OpenAI
|
||||
|
||||
#OPENAI_API_KEY: "YOUR_API_KEY"
|
||||
#OPENAI_API_BASE: "YOUR_API_BASE"
|
||||
## The official OPENAI_API_BASE is https://api.openai.com/v1
|
||||
## If the official OPENAI_API_BASE is not available, we recommend using the [openai-forward](https://github.com/beidongjiedeguang/openai-forward).
|
||||
## Or, you can configure OPENAI_PROXY to access official OPENAI_API_BASE.
|
||||
OPENAI_API_BASE: "https://api.openai.com/v1"
|
||||
#OPENAI_PROXY: "http://127.0.0.1:8118"
|
||||
#OPENAI_API_KEY: "YOUR_API_KEY"
|
||||
OPENAI_API_MODEL: "gpt-4"
|
||||
MAX_TOKENS: 1500
|
||||
RPM: 10
|
||||
|
|
@ -57,7 +59,6 @@ SD_T2I_API: "/sdapi/v1/txt2img"
|
|||
#LONG_TERM_MEMORY: false
|
||||
|
||||
#### for Mermaid CLI
|
||||
# adds support for installing mmdc (Mermaid CLI) locally on the user's machine.
|
||||
# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install @mermaid-js/mermaid-cli
|
||||
#PUPPETEER_CONFIG: "./puppeteer-config.json"
|
||||
## If you installed mmdc (Mermaid CLI) only for metagpt then enable the following configuration.
|
||||
#PUPPETEER_CONFIG: "./config/puppeteer-config.json"
|
||||
#MMDC: "./node_modules/.bin/mmdc"
|
||||
|
|
@ -16,8 +16,6 @@ from metagpt.utils.common import check_cmd_exists
|
|||
IS_DOCKER = os.environ.get('AM_I_IN_A_DOCKER_CONTAINER', 'false').lower()
|
||||
|
||||
|
||||
|
||||
|
||||
def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height=2048) -> int:
|
||||
"""suffix: png/svg/pdf
|
||||
|
||||
|
|
@ -41,15 +39,15 @@ def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height
|
|||
# Call the `mmdc` command to convert the Mermaid code to a PNG
|
||||
logger.info(f"Generating {output_file}..")
|
||||
if IS_DOCKER == 'true':
|
||||
subprocess.run(['mmdc', '-p', '/app/metagpt/puppeteer-config.json', '-i',
|
||||
subprocess.run(['mmdc', '-p', '/app/metagpt/config/puppeteer-config.json', '-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)])
|
||||
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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue