chore: nettoyage repo JARVIS v3 + docs à jour
- Suppression 37 fichiers scratch/debug (Pipecat exploration : _debug*, check_*, test_*, ws_test*, bot.py, start.sh, run_bot*, run_direct.py) - Garde uniquement l'essentiel : bot_direct.py, launcher.py, README.md, .gitignore - .gitignore renforcé (patterns scratch/debug) - README réécrit selon l'état réel (Phase 1 terminée, Phase 2 audio partielle TTS/STT) - Roadmap 6 phases documentée
This commit is contained in:
@@ -1,106 +1,47 @@
|
||||
# JARVIS v3 — Assistant Vocal Intelligent
|
||||
|
||||
> Phase 1 : Relay WebSocket → Hermes A.L.E.X.A.
|
||||
> PoC fonctionnel — interface chat texte en temps réel
|
||||
Assistant vocal local connecté à l'agent Hermes (DeepSeek v4). Contexte multi-tours,
|
||||
interface navigateur, synthèse vocale (TTS), liaison vocale (STT navigateur).
|
||||
|
||||
## 🎯 Objectif
|
||||
|
||||
Assistant vocal intelligent avec mémoire persistante, connecté à l'API Hermes A.L.E.X.A.
|
||||
Phase 1 valide la communication texte en temps réel via WebSocket.
|
||||
> **Était le projet `jarvis-pipecat`** (historique nommé d'après Pipecat, non utilisé actuellement).
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
```
|
||||
┌──────────────┐ WebSocket ┌──────────────┐ HTTP/POST ┌──────────────┐
|
||||
│ Navigateur │ ◄──────────────► │ bot_direct │ ◄───────────────► │ Hermes API │
|
||||
│ (test.html) │ ws://host/ws │ .py :7081 │ localhost:8642 │ A.L.E.X.A. │
|
||||
└──────────────┘ └──────────────┘ └──────────────┘
|
||||
│
|
||||
▼
|
||||
┌──────────────┐
|
||||
│ Infisical │
|
||||
│ (clé API) │
|
||||
└──────────────┘
|
||||
┌──────────────┐ WebSocket ┌──────────────┐ HTTP REST ┌──────────────┐
|
||||
│ Navigateur │ ◄────────────► │ bot_direct │ ◄─────────────► │ Hermes API │
|
||||
│ (HTML/JS) │ ws://:7081/ws │ .py :7081 │ :8642 /v1/chat │ A.L.E.X.A. │
|
||||
│ 🎤 STT 🔊 │ │ TTS edge │ /completions │ (DeepSeek v4)│
|
||||
└──────────────┘ │ (serveur) │ └──────────────┘
|
||||
└──────┬───────┘
|
||||
▼ Infisical (clé) / fallback .env
|
||||
```
|
||||
|
||||
- **STT** : Web Speech API navigateur (Chrome) — nécessite HTTPS ou flag (voir Bloqueurs).
|
||||
- **TTS** : `edge-tts` côté serveur (voix `fr-FR-DeniseNeural`), MP3 → base64 → `<audio>`.
|
||||
- **LLM** : API Hermes (`Hermes Agent` / DeepSeek v4), temperature 0.8, max 300 tokens, 20 messages de contexte.
|
||||
|
||||
## 📦 Fichiers
|
||||
|
||||
| Fichier | Rôle |
|
||||
|---------|------|
|
||||
| `bot_direct.py` | Serveur WebSocket + interface HTML inline |
|
||||
| `launcher.py` | Récupère la clé Hermes via Infisical puis lance `bot_direct.py` |
|
||||
| `run_direct.py` | Lanceur manuel (alternative à systemd) |
|
||||
| `bot.py` | Tentative Pipecat 1.4.0 (non fonctionnel — pour référence) |
|
||||
| `test.html` | Interface chat (intégrée inline dans `bot_direct.py`) |
|
||||
| `start.sh` | Script Pipecat original (obsolète) |
|
||||
| `bot_direct.py` | Serveur WebSocket + interface HTML embarquée (entrée principale) |
|
||||
| `launcher.py` | Récupère la clé Hermes (Infisical → fallback `.env`) puis lance `bot_direct.py` |
|
||||
| `README.md` | Ce document |
|
||||
|
||||
## 🚀 Démarrage
|
||||
|
||||
### Avec systemd (recommandé)
|
||||
### Service systemd (recommandé)
|
||||
|
||||
```bash
|
||||
# Statut
|
||||
systemctl --user status jarvis-v3
|
||||
# Activer + démarrer
|
||||
systemctl --user enable --now jarvis-v3
|
||||
|
||||
# Logs
|
||||
# Statut / logs
|
||||
systemctl --user status jarvis-v3
|
||||
journalctl --user -u jarvis-v3 -f
|
||||
|
||||
# Redémarrer
|
||||
systemctl --user restart jarvis-v3
|
||||
```
|
||||
|
||||
### Manuel
|
||||
|
||||
```bash
|
||||
cd ~/workspace/jarvis-pipecat
|
||||
source venv/bin/activate
|
||||
python3 run_direct.py
|
||||
```
|
||||
|
||||
## 🌐 Accès
|
||||
|
||||
- **URL** : http://openclaw1.dev.home:7081/
|
||||
- **WebSocket** : ws://openclaw1.dev.home:7081/ws
|
||||
- **Port** : 7081 (configurable via `JARVIS_PORT`)
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
| Variable | Valeur | Description |
|
||||
|----------|--------|-------------|
|
||||
| `JARVIS_PORT` | `7081` | Port d'écoute |
|
||||
| `HERMES_API_KEY` | *(Infisical)* | Clé API Hermes |
|
||||
| `HERMES_URL` | `http://localhost:8642/v1/chat/completions` | Endpoint API |
|
||||
|
||||
## 🔑 Secret
|
||||
|
||||
La clé API Hermes est stockée dans **Infisical** (`/hermes-claw/API_SERVER_KEY`).
|
||||
Le launcher (`launcher.py`) la récupère automatiquement au démarrage.
|
||||
|
||||
## 🛠️ Dépendances
|
||||
|
||||
```
|
||||
websockets==16.0
|
||||
httpx
|
||||
```
|
||||
|
||||
Installées dans `venv/`.
|
||||
|
||||
## 📊 Roadmap
|
||||
|
||||
| Phase | Contenu | Statut |
|
||||
|-------|---------|--------|
|
||||
| **Phase 1** | Chat texte WebSocket + Hermes | ✅ Stable |
|
||||
| **Phase 2** | Audio (STT Parakeet + TTS Edge/Kokoro) | 🔜 Planifié |
|
||||
| **Phase 3** | Intégration Pipecat WebRTC | 🔜 Planifié |
|
||||
| **Phase 4** | Multi-agent, barge-in, wake word | 📋 Backlog |
|
||||
|
||||
## 🔧 Maintenance
|
||||
|
||||
```bash
|
||||
# Voir les logs
|
||||
journalctl --user -u jarvis-v3 -n 50
|
||||
|
||||
# Redémarrer après modification
|
||||
# Redémarrer après modification de code
|
||||
rm -rf ~/workspace/jarvis-pipecat/__pycache__/
|
||||
systemctl --user restart jarvis-v3
|
||||
|
||||
@@ -108,14 +49,74 @@ systemctl --user restart jarvis-v3
|
||||
systemctl --user stop jarvis-v3
|
||||
```
|
||||
|
||||
## 📝 Notes techniques
|
||||
### Manuel (debug)
|
||||
|
||||
- **websockets 16.0** : `respond()` ne prend que `(status, text)`. Pour les headers custom,
|
||||
retourner un objet `Response` manuellement (`from websockets.http11 import Response, Headers`).
|
||||
- **Content-Type** : doit être `text/html; charset=utf-8` pour que le navigateur rende l'interface.
|
||||
- **Pipecat 1.4.0** : API massivement refactorée, `LLMMessagesFrame` supprimée, `LLMContext`
|
||||
n'est plus un processeur. Abandonné pour la Phase 1, à réévaluer en Phase 3.
|
||||
```bash
|
||||
cd ~/workspace/jarvis-pipecat
|
||||
source venv/bin/activate
|
||||
python3 launcher.py
|
||||
```
|
||||
|
||||
## 🌐 Accès
|
||||
|
||||
- **Interface** : http://openclaw1.dev.home:7081/
|
||||
- **WebSocket** : ws://openclaw1.dev.home:7081/ws
|
||||
- **Port** : `7081`, configurable via `JARVIS_PORT`
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
| Variable | Valeur | Description |
|
||||
|----------|--------|-------------|
|
||||
| `JARVIS_PORT` | `7081` | Port d'écoute |
|
||||
| `HERMES_API_KEY` | — | Clé API Hermes (via Infisical ou `.env`) |
|
||||
| `HERMES_URL` | `http://localhost:8642/v1/chat/completions` | Endpoint Hermes |
|
||||
|
||||
La clé est récupérée par `launcher.py` : **Infisical** (`/hermes-claw/API_SERVER_KEY`)
|
||||
puis **fallback** `~/workspace/.env` (`HERMES_ALEXA_KEY`).
|
||||
|
||||
## 📊 Roadmap
|
||||
|
||||
| Phase | Contenu | Statut |
|
||||
|-------|---------|--------|
|
||||
| **Phase 1** | Chat texte WebSocket → Hermes (contexte 20 msgs, reconnexion auto, timeout) | ✅ Terminé |
|
||||
| **Phase 2** | **Audio** — TTS edge-tts + STT navigateur | 🟡 Partiel (TTS ✅ / STT ⚠️) |
|
||||
| **Phase 3** | Stabilité & qualité vocale — STT local, TTS naturel, streaming | 🔜 |
|
||||
| **Phase 4** | Orchestration Pipecat — flux STT→LLM→TTS, barge-in, WebRTC | 🔜 |
|
||||
| **Phase 5** | Fonctionnalités — wake word, tool calling, mémoire Honcho | 📋 |
|
||||
| **Phase 6** | Production — HTTPS/WSS, auth, multi-user, Docker, monitoring | 📋 |
|
||||
|
||||
Détail complet : **Obsidian** `3.5_PROJETS/JARVIS/JARVIS.md` (roadmap + statut).
|
||||
|
||||
## ⚠️ Bloqueurs connus
|
||||
|
||||
1. **STT `network` error** — la Web Speech API est bloquée par Chrome en HTTP.
|
||||
→ Solution rapide : flag `chrome://flags/#unsafely-treat-insecure-origin-as-secure` + `http://openclaw1.dev.home:7081`.
|
||||
→ Solution durable (Phase 3) : **Whisper local** (faster-whisper / whisper.cpp) — STT côté serveur, plus HTTPS requis.
|
||||
2. **TTS non streamé** — attend la fin de la réponse LLM (~7 s ajoutées). Cible Phase 3 : < 5 s.
|
||||
3. **HTTP non chiffré** — pas encore de HTTPS/WSS (Phase 6).
|
||||
4. **Toujours en écoute impossible** — il faut déclencher le micro ; wake word prévu Phase 5.
|
||||
|
||||
## 🛠️ Dépendances
|
||||
|
||||
```
|
||||
websockets==16.0
|
||||
httpx
|
||||
edge-tts
|
||||
```
|
||||
|
||||
→ installées dans `venv/`.
|
||||
|
||||
## 📝 Notes techniques (pitfalls)
|
||||
|
||||
- **websockets 16.0** : `respond()` ne prend que `(status, text)`. Pour headers custom,
|
||||
retourner un objet `Response` du module `websockets.http11` (`Response, Headers`).
|
||||
- **Cache navigateur** : `bot_direct.py` renvoie `Cache-Control: no-store` sur les pages HTML.
|
||||
- **Cache Python** : après modification de `bot_direct.py`, supprimer `__pycache__/` avant le redémarrage.
|
||||
- **Pipecat abandonné** pour le moment : API 1.4.0 massivement refactorée (`LLMMessagesFrame`
|
||||
supprimée, `LLMContext` n'est plus un processeur). À réévaluer en Phase 4.
|
||||
- **Ne pas committer** les fichiers scratch/debug : `.gitignore` couvre `_check*`, `_debug*`,
|
||||
`test_*.py`, `check_*.py`, `*_out.txt`, etc.
|
||||
|
||||
## 📄 Licence
|
||||
|
||||
Projet personnel — Bruno Charest, 2026.
|
||||
Projet personnel — Bruno Charest, 2026.
|
||||
Reference in New Issue
Block a user