Files
2026-09-25 05:50:27 +00:00

124 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Thorsten Voice Assistant
Modularer, lokaler Sprachassistent auf Basis von Piper TTS + llama.cpp.
## Architektur
```
input_helper.py
│
│ data/llm_input.json
▼
llm_module.py (Qwen2.5-0.5B via llama-cpp-python)
│
│ data/tts_input.json
▼
tts_module.py (Thorsten Emotional Voice via Piper)
│
▼
data/output.wav
```
### JSON-Formate
**llm_input.json** (Helper → LLM):
```json
{
"request": "Was ist die Hauptstadt von Frankreich?",
"type": "query",
"emotion": "neutral",
"autoplay": true,
"history": []
}
```
**tts_input.json** (LLM → TTS):
```json
{
"text": "Die Hauptstadt von Frankreich ist Paris.",
"emotion": "neutral",
"speaker_id": 4,
"output_file": "data/output.wav",
"autoplay": true
}
```
### Verfügbare Emotionen
beim input helper
| Name | Speaker ID |
|------|-----------|
| amused | 0 |
| angry | 1 |
| disgusted | 2 |
| drunk | 3 |
| **neutral** | **4** |
| sleepy | 5 |
| surprised | 6 |
| whisper | 7 |
---
## Einrichtung
```bash
# 1. Modell herunterladen (einmalig, ~400 MB)
python download_model.py
```
---
## Verwendung
### Interaktiver Modus (Entwicklung)
```bash
python input_helper.py
```
Terminalbefehle im interaktiven Modus:
- `/emotion drunk` – Emotion wechseln
- `/history` – Gesprächsverlauf anzeigen
- `/clear` – Verlauf löschen
- `/exit` – Beenden
### Einmaliger Aufruf
```bash
python input_helper.py "Was ist das Wetter heute?"
python input_helper.py "Guten Morgen" --emotion amused
python input_helper.py "Leise Nachricht" --emotion whisper --no-play
```
### Module direkt aufrufen
```bash
# Nur LLM (mit JSON-Datei)
python llm_module.py data/llm_input.json
# Nur TTS (mit JSON-Datei)
python tts_module.py data/tts_input.json
# TTS mit Pipe
echo '{"text":"Hallo Welt","emotion":"neutral"}' | python tts_module.py
```
---
## Dateien
| Datei | Beschreibung |
|-------|-------------|
| `input_helper.py` | Terminal-Eingabe → JSON → LLM → TTS |
| `llm_module.py` | LLM-Verarbeitung mit Qwen GGUF |
| `tts_module.py` | Text-to-Speech mit Thorsten Emotional |
| `download_model.py` | Lädt Qwen-Modell herunter |
| `thorsten.py` | (Alt) Ursprüngliches Test-Script |
| `models/` | GGUF-Modelle |
| `data/` | JSON-Austausch-Dateien & Audio-Output |
---
## Erweiterung (zukünftige Module)
Das System implementiert bis jetzt nur den voice compiler und das llm und der rest sind nur skripts zum helfen des testen
![Plan](./plan.jpg)