| |
| """ |
| Test that all .lower() errors are fixed |
| """ |
|
|
| import os |
| os.environ["ANTHROPIC_API_KEY"] = "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" |
|
|
| from app import BasicAgent |
|
|
| def test_with_problematic_questions(): |
| """Test questions that might cause .lower() errors""" |
| |
| print("Testing GAIA agent with potentially problematic questions...") |
| print("-" * 60) |
| |
| agent = BasicAgent() |
| agent.set_api_key(os.environ["ANTHROPIC_API_KEY"]) |
| |
| test_questions = [ |
| |
| "What is 2 + 2?", |
| |
| |
| "Who is the current president of France?", |
| |
| |
| "What is the output of: print([1,2,3])", |
| |
| |
| "Look at the image and describe what you see", |
| ] |
| |
| for i, question in enumerate(test_questions, 1): |
| print(f"\nTest {i}: {question}") |
| try: |
| answer = agent(question) |
| print(f"β
Success: {answer[:100]}...") |
| except AttributeError as e: |
| if "lower" in str(e): |
| print(f"β LOWER ERROR: {e}") |
| else: |
| print(f"β Other AttributeError: {e}") |
| except Exception as e: |
| print(f"β Other error ({type(e).__name__}): {e}") |
|
|
| if __name__ == "__main__": |
| print("=" * 80) |
| print("Final Test - All .lower() errors should be fixed") |
| print("=" * 80) |
| |
| test_with_problematic_questions() |
| |
| print("\n" + "=" * 80) |
| print("If you see any 'lower' errors above, we missed a spot!") |
| print("=" * 80) |