mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.75k stars 6.08k forks source link

Support a dialogue diagram #5458

Open hanchchch opened 2 months ago

hanchchch commented 2 months ago

Proposal

The dialogue diagram would be useful to demonstrate a dialogue, especially for prototyping a chatbot. I mean, to keep up with the LLM trend !

Use Cases

The dialogue diagram could be used for demonstrating a LLM chatbot.

Screenshots

Screenshot 2024-04-12 at 4 22 39 PM

Syntax

dialogue
  role center cloud System
  role right User
  role left Assistant
  function left dotted find_joke

  System: You are a helpful assistant.
  User: Tell me a joke about mermaid.
  find_joke("mermaid") returns "Mermaid wore seashells to the math class"
  Assistant: `Why did the mermaid wear seashells to the math class?

  Because she wanted to improve her shell-fish abilities!`

Implementation

I will try and implement it myself.

sidharthv96 commented 2 months ago

Please go through https://github.com/mermaid-js/mermaid/issues/5367#issuecomment-1985747493 and related discussions before writing the code, we are moving from Jison to Langium.