File size: 985 Bytes
6f22d1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
"""
Test simple del cliente HuggingChat
"""

import sys
import os
from pathlib import Path

# Agregamos el directorio src al path
project_root = Path(__file__).parent
src_path = project_root / "src"
sys.path.insert(0, str(src_path))

def test_client():
    try:
        print("🔧 Importando HuggingChatClient...")
        from huggingchat_client import HuggingChatClient
        
        print("🔧 Inicializando cliente...")
        client = HuggingChatClient()
        
        print("📤 Enviando mensaje de prueba...")
        response = client.send_message("Hola, responde solo 'Funcionando' para confirmar que todo está bien")
        
        print(f"📥 Respuesta recibida: {response}")
        print("✅ Test completado exitosamente!")
        return True
        
    except Exception as e:
        print(f"❌ Error en el test: {e}")
        return False

if __name__ == "__main__":
    success = test_client()
    sys.exit(0 if success else 1)