🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: mermaid + font
莘权 马832494706e7f
diff --git a/metagpt/utils/mermaid.py b/metagpt/utils/mermaid.pyindex 008bb849d..88e58ae44 100644--- a/metagpt/utils/mermaid.py+++ b/metagpt/utils/mermaid.py@@ -7,6 +7,7 @@"""import asyncioimport os+import refrom pathlib import Pathfrom typing import List, Optional@@ -38,6 +39,9 @@ async def mermaid_to_file(Returns:int: 0 if the conversion is successful, -1 if the conversion fails."""+ file_head = "%%{init: {'theme': 'default', 'themeVariables': { 'fontFamily': 'Inter' }}}%%\n"+ if not re.match(r"^%%\{.+", mermaid_code):+ mermaid_code = file_head + mermaid_codesuffixes = suffixes or ["svg"]# Write the Mermaid code to a temporary fileconfig = config if config else Config.default()