Download test_simple.py from FLAFUENTE/HUGCHAT: direct link, hf CLI and curl.
- Browser
- Download file 985 Bytes
-
https://huggingface.co/spaces/FLAFUENTE/HUGCHAT/resolve/main/test_simple.py
- Command line
-
hf download hf://spaces/FLAFUENTE/HUGCHAT/test_simple.py
-
curl -L -o test_simple.py https://huggingface.co/spaces/FLAFUENTE/HUGCHAT/resolve/main/test_simple.py
985 Bytes
| #!/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) |