Skip to content

Commit 038394a

Browse files
authored
readme: update gobot flow diagram (#13)
Add a small description, too Signed-off-by: Milos Gajdos <[email protected]>
1 parent fdab924 commit 038394a

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

README.md

+17-10
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,29 @@ flowchart TB
7171
Go(go)
7272
Rust(rust)
7373
end
74-
Go-->jetReader
75-
jetWriter-->Rust
76-
jetReader-->prompts
77-
prompts-->llm
74+
Go-- 1. -->jetReader
75+
jetWriter-- 7. -->Rust
76+
jetReader-- 2. -->prompts
77+
prompts-- 3. -->llm
7878
llm-->ollama
79-
llm-->ttsChunks
80-
llm-->jetChunks
79+
llm-- 4. -->ttsChunks
80+
llm-- 4. -->jetChunks
8181
jetChunks-->jetWriter
8282
ttsChunks-->tts
83-
tts-->playht
84-
tts-->ttsDone
83+
tts-- 5. -->playht
84+
tts-- 6. -->ttsDone
8585
ttsDone-->jetWriter
8686
```
8787

88+
1. `jet.Reader` receives a message published on a JetStream subject
89+
2. `jet.Reader` sends this message to the `prompts` channel
90+
3. `llm` worker reads the messages sent to the `prompts` channel and forwards them to ollama for LLM generation
91+
4. ollama generates the response and the `llm` worker sends it to both `ttsChunks` and `jetChunks` channels
92+
5. `tts` worker reads the message and sends the message to PlayHT API and streams the audio to the default audio device;
93+
6. once the playback has finished `tts` worker notifies `jet.Writer` via the `ttsDone` channel that it's done playing audio
94+
6. `jet.Writer` receives the notification on the `ttsDone` channel and publishes the message it received on `jetChunks` channel
95+
to a JetStream subject
96+
8897
# HOWTO
8998

9099
There are a few prerequisites:
@@ -169,5 +178,3 @@ Start the `rustbot`:
169178
```shell
170179
cargo run --manifest-path rustbot/Cargo.toml
171180
```
172-
173-

0 commit comments

Comments
 (0)