-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_chatbot.py
More file actions
44 lines (34 loc) · 1.16 KB
/
test_chatbot.py
File metadata and controls
44 lines (34 loc) · 1.16 KB
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
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""
Script de prueba para el chatbot RAG mejorado
"""
from rag_chatbot import RAGChatbot
def test_chatbot():
"""Probar el chatbot con preguntas específicas"""
print("🧪 Iniciando pruebas del ChatBot RAG mejorado...")
# Inicializar chatbot
chatbot = RAGChatbot()
# Preguntas de prueba
test_questions = [
"¿Qué es ADO.NET?",
"¿Cómo se conecta a una base de datos en C#?",
"Muéstrame un ejemplo de SqlConnection",
"¿Qué es un DataReader?",
"¿Cómo se usa un DataAdapter?"
]
print("\n" + "="*50)
print("PRUEBAS DEL CHATBOT")
print("="*50)
for i, question in enumerate(test_questions, 1):
print(f"\n🔍 Prueba {i}: {question}")
print("-" * 40)
try:
response = chatbot.chat(question)
print(f"🤖 Respuesta: {response}")
except Exception as e:
print(f"❌ Error: {e}")
print("-" * 40)
print("\n✅ Pruebas completadas!")
print("\nPara usar el chatbot interactivo, ejecuta: python rag_chatbot.py")
if __name__ == "__main__":
test_chatbot()