Skip to content

Commit fdab924

Browse files
authored
update: add mermaid diagrams to README (#12)
* update: add mermaid diagrams to README Signed-off-by: Milos Gajdos <[email protected]> --------- Signed-off-by: Milos Gajdos <[email protected]>
1 parent 5348ef9 commit fdab924

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

README.md

+74
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,80 @@ It uses [NATS jetstream](https://docs.nats.io/nats-concepts/jetstream) for messa
1111
> This project was built purely for educational purposes and thus is likely ridden with bugs, inefficiencies, etc.
1212
> You should consider this project as highly experimental.
1313
14+
## Bot Conversation Flow
15+
16+
```mermaid
17+
sequenceDiagram
18+
participant GoTTS as TTS
19+
participant GoLLM as LLM
20+
participant Gobot
21+
participant Rustbot
22+
participant RustLLM as LLM
23+
participant RustTTS as TTS
24+
Gobot->>+Rustbot: Hi Rustbot!
25+
Rustbot->>RustLLM: Hi Rustbot!
26+
RustLLM->>RustTTS: Hi Gobot!
27+
RustLLM->>Rustbot: Hi Gobot!
28+
Rustbot->>-Gobot: Hi Gobot!
29+
activate Gobot
30+
Gobot->>GoLLM: Hi Gobot!
31+
GoLLM->>GoTTS: Teach me about Rust!
32+
GoLLM->>Gobot: Teach me about Rust!
33+
Gobot->>-Rustbot: Teach me about Rust!
34+
```
35+
36+
## Architecture
37+
38+
Zoomed in view on the high-level architecture:
39+
40+
```mermaid
41+
flowchart TB
42+
subgraph " "
43+
playht(PlayHT API)
44+
ollama(Ollama)
45+
end
46+
bot <-->ollama
47+
bot <-->playht
48+
bot <--> NATS[[NATS JetStream]]
49+
```
50+
51+
## Tasks, Goroutines, Channels
52+
53+
> [!NOTE]
54+
> Mermaid does not have proper support for controlling layout or even basic graph legends
55+
> There are some terrible workarounds, so I've opted not to use them in this README, hence
56+
> the diagram might feel a bit unwieldy
57+
58+
```mermaid
59+
flowchart TB
60+
ollama{Ollama}
61+
playht{PlayHT}
62+
llm((llm))
63+
tts((tts))
64+
jetWriter((jetWriter))
65+
jetReader((jetReader))
66+
ttsChunks(ttsChunks)
67+
jetChunks(jetChunks)
68+
prompts(prompts)
69+
ttsDone(ttsDone)
70+
subgraph NATS JetStream
71+
Go(go)
72+
Rust(rust)
73+
end
74+
Go-->jetReader
75+
jetWriter-->Rust
76+
jetReader-->prompts
77+
prompts-->llm
78+
llm-->ollama
79+
llm-->ttsChunks
80+
llm-->jetChunks
81+
jetChunks-->jetWriter
82+
ttsChunks-->tts
83+
tts-->playht
84+
tts-->ttsDone
85+
ttsDone-->jetWriter
86+
```
87+
1488
# HOWTO
1589

1690
There are a few prerequisites:

0 commit comments

Comments
 (0)