agents-course-v2 / tests /test_single.py
D3MI4N's picture
clean up project repo
b36ff59
raw
history blame contribute delete
966 Bytes
"""
Test a single problematic question to debug the routing logic.
"""
import os
import sys
# Add parent directory to path for imports
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from agent import answer_gaia_question
from tools.database_tools import get_retriever
def test_single_question():
"""Test one question that was causing infinite loops."""
question = "How many papers published by Science in 2020 would be incorrect if they used p-value of 0.03?"
print(f"πŸ§ͺ Testing Single Question")
print(f"πŸ“ Question: {question}")
print("=" * 80)
try:
# Test with debug enabled to see the flow
answer = answer_gaia_question(question, debug=True)
print(f"\n🎯 Final Answer: {answer}")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_single_question()