Skip to content

Commit

Permalink
update: add mermaid diagrams to README (#12)
Browse files Browse the repository at this point in the history
* update: add mermaid diagrams to README

Signed-off-by: Milos Gajdos <[email protected]>

---------

Signed-off-by: Milos Gajdos <[email protected]>
  • Loading branch information
milosgajdos authored Apr 25, 2024
1 parent 5348ef9 commit fdab924
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,80 @@ It uses [NATS jetstream](https://docs.nats.io/nats-concepts/jetstream) for messa
> This project was built purely for educational purposes and thus is likely ridden with bugs, inefficiencies, etc.
> You should consider this project as highly experimental.
## Bot Conversation Flow

```mermaid
sequenceDiagram
participant GoTTS as TTS
participant GoLLM as LLM
participant Gobot
participant Rustbot
participant RustLLM as LLM
participant RustTTS as TTS
Gobot->>+Rustbot: Hi Rustbot!
Rustbot->>RustLLM: Hi Rustbot!
RustLLM->>RustTTS: Hi Gobot!
RustLLM->>Rustbot: Hi Gobot!
Rustbot->>-Gobot: Hi Gobot!
activate Gobot
Gobot->>GoLLM: Hi Gobot!
GoLLM->>GoTTS: Teach me about Rust!
GoLLM->>Gobot: Teach me about Rust!
Gobot->>-Rustbot: Teach me about Rust!
```

## Architecture

Zoomed in view on the high-level architecture:

```mermaid
flowchart TB
subgraph " "
playht(PlayHT API)
ollama(Ollama)
end
bot <-->ollama
bot <-->playht
bot <--> NATS[[NATS JetStream]]
```

## Tasks, Goroutines, Channels

> [!NOTE]
> Mermaid does not have proper support for controlling layout or even basic graph legends
> There are some terrible workarounds, so I've opted not to use them in this README, hence
> the diagram might feel a bit unwieldy
```mermaid
flowchart TB
ollama{Ollama}
playht{PlayHT}
llm((llm))
tts((tts))
jetWriter((jetWriter))
jetReader((jetReader))
ttsChunks(ttsChunks)
jetChunks(jetChunks)
prompts(prompts)
ttsDone(ttsDone)
subgraph NATS JetStream
Go(go)
Rust(rust)
end
Go-->jetReader
jetWriter-->Rust
jetReader-->prompts
prompts-->llm
llm-->ollama
llm-->ttsChunks
llm-->jetChunks
jetChunks-->jetWriter
ttsChunks-->tts
tts-->playht
tts-->ttsDone
ttsDone-->jetWriter
```

# HOWTO

There are a few prerequisites:
Expand Down

0 comments on commit fdab924

Please sign in to comment.