chore: stabilisation Phase 1 — reconnexion auto, timeout LLM, systemd, README
- Ajout reconnexion auto WebSocket avec backoff exponentiel (2s→30s, max 20 tentatives) - Ajout timeout LLM côté frontend (25s) avec réactivation du bouton - Réduction timeout serveur httpx 60→45s - Service systemd user jarvis-v3 (survit aux reboots) - Launcher Python avec fallback .env si Infisical expiré - README.md complet (architecture, URLs, roadmap, maintenance) - .gitignore (venv, pycache, logs)
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
# JARVIS v3 — Assistant Vocal Intelligent
|
||||
|
||||
> Phase 1 : Relay WebSocket → Hermes A.L.E.X.A.
|
||||
> PoC fonctionnel — interface chat texte en temps réel
|
||||
|
||||
## 🎯 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.
|
||||
|
||||
## 🏗️ 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) │
|
||||
└──────────────┘
|
||||
```
|
||||
|
||||
## 📦 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) |
|
||||
|
||||
## 🚀 Démarrage
|
||||
|
||||
### Avec systemd (recommandé)
|
||||
|
||||
```bash
|
||||
# Statut
|
||||
systemctl --user status jarvis-v3
|
||||
|
||||
# Logs
|
||||
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
|
||||
rm -rf ~/workspace/jarvis-pipecat/__pycache__/
|
||||
systemctl --user restart jarvis-v3
|
||||
|
||||
# Arrêter
|
||||
systemctl --user stop jarvis-v3
|
||||
```
|
||||
|
||||
## 📝 Notes techniques
|
||||
|
||||
- **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.
|
||||
|
||||
## 📄 Licence
|
||||
|
||||
Projet personnel — Bruno Charest, 2026.
|
||||
Reference in New Issue
Block a user