@@ -11,6 +11,80 @@ It uses [NATS jetstream](https://docs.nats.io/nats-concepts/jetstream) for messa
11
11
> This project was built purely for educational purposes and thus is likely ridden with bugs, inefficiencies, etc.
12
12
> You should consider this project as highly experimental.
13
13
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
+
14
88
# HOWTO
15
89
16
90
There are a few prerequisites:
0 commit comments