feat: JARVIS v3 Phase 1 — WebSocket relay vers Hermes A.L.E.X.A.
- Serveur WebSocket direct avec websockets 16.0 - Interface HTML/CSS/JS dark theme avec chat - Relay vers API Hermes sur port 8642 - Historique de conversation (20 messages) - Clé API via Infisical - Testé et fonctionnel sur openclaw1.dev.home:7081
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
|
||||
import asyncio
|
||||
import websockets
|
||||
import json
|
||||
import sys
|
||||
|
||||
async def test():
|
||||
print("🔌 Connexion WebSocket à ws://localhost:7081/ws...")
|
||||
try:
|
||||
async with websockets.connect('ws://localhost:7081/ws', open_timeout=10) as ws:
|
||||
print("✅ Connecté!")
|
||||
|
||||
# Receive welcome message
|
||||
try:
|
||||
msg = await asyncio.wait_for(ws.recv(), timeout=15)
|
||||
print(f"📩 Message de bienvenue: {msg[:300]}")
|
||||
except asyncio.TimeoutError:
|
||||
print("⚠️ Pas de message de bienvenue (normal si pas d'event handler)")
|
||||
|
||||
# Send a question
|
||||
print("📤 Envoi: 'Quelle heure est-il ?'")
|
||||
await ws.send("Quelle heure est-il ?")
|
||||
|
||||
# Get response
|
||||
try:
|
||||
response = await asyncio.wait_for(ws.recv(), timeout=60)
|
||||
print(f"📩 Réponse: {response[:500]}")
|
||||
except asyncio.TimeoutError:
|
||||
print("❌ Timeout: pas de réponse du LLM en 60s")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Erreur: {e}")
|
||||
|
||||
asyncio.run(test())
|
||||
Reference in New Issue
Block a user