MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

removes npm dependency by using mermaid ink service | removes referen…

Open romechenko opened this issue 1 year ago • 3 comments

Remove the dependency on npm

This issue is document as issue 167

Changes

  • removes the dependency on npm by using the mermaid ink service
  • removes references to the npm version mermaid and the related issues that is causes

Description of changes

This changes the way that mermaid.py works. Instead of doing checks to see if the npm command exists for mermaid, it makes a call to the mermaid ink service. This service takes a base64 encoded string as the mermaid code and can return either an svg or png depending on the path.

Testing

A simple test to see if this new approach works is to run the mermaid.py file and see if the mermaid charts are created in the tmp folder in the project root.

Warning

This does remove the pdf file output type.

I don't see this as an issue but someone else might.

romechenko avatar Aug 24 '23 22:08 romechenko

This is a very good submission that can lower the threshold for users to use

But when faced with third-party network requirements, I have several questions

  1. This requires a default network dependency, but this assumption may not be true in the future, such as using Llama's intranet deployment, which means it is more reasonable to make it an option?
  2. What is the payment policy for third-party services? Is it free forever? Does it promises service stability?
  3. If the third-party service is down, what is our strategy?

geekan avatar Sep 04 '23 03:09 geekan

had better submit as a optional solution, not directly replace the original one. feel free to have a look mine solution https://github.com/geekan/MetaGPT/pull/289

alitrack avatar Sep 05 '23 09:09 alitrack

Good idea! It may be helpful when the mermaid install fails. Can you resolve the conflicts? And provide test codes for this, please. In addition, it will be convenient if it is configurable for installation and usage

stellaHSR avatar Sep 05 '23 14:09 stellaHSR