Spaces:
Running
Running
File size: 3,301 Bytes
9a6a4dc |
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
#!/usr/bin/env python3
"""
Test Enhanced AGNO Agent with European Open-Source Multimodal Tools
"""
import os
import sys
import logging
from pathlib import Path
# Add the deployment-ready directory to the path
sys.path.insert(0, str(Path(__file__).parent))
# Set up logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def test_agent_initialization():
"""Test that the enhanced agent initializes correctly with multimodal tools."""
print("π§ͺ Testing Enhanced AGNO Agent with European Multimodal Tools...")
try:
from agents.enhanced_unified_agno_agent import GAIAAgent, get_agent_status
print("β
Successfully imported enhanced agent")
# Get agent status
status = get_agent_status()
print(f"π Agent Status: {status}")
# Check if multimodal tools are available
if status.get('multimodal_tools_available'):
print("β
European open-source multimodal tools are available")
multimodal_status = status.get('multimodal_status', {})
if multimodal_status:
print(f"πͺπΊ Multimodal capabilities: {multimodal_status.get('capabilities', {})}")
print(f"π§ Multimodal models: {multimodal_status.get('models', {})}")
else:
print("β οΈ European open-source multimodal tools not available")
print(f"π§ Total tools available: {status.get('tools_count', 0)}")
return True
except Exception as e:
print(f"β Error testing agent: {e}")
import traceback
traceback.print_exc()
return False
def test_simple_question():
"""Test the agent with a simple question."""
print("\nπ§ͺ Testing simple question processing...")
try:
from agents.enhanced_unified_agno_agent import process_question
# Test with a simple mathematical question
question = "What is 15 * 23?"
print(f"β Question: {question}")
answer = process_question(question)
print(f"β
Answer: {answer}")
return True
except Exception as e:
print(f"β Error processing question: {e}")
import traceback
traceback.print_exc()
return False
def main():
"""Run all tests."""
print("π Starting Enhanced AGNO Agent Tests with European Multimodal Tools")
print("=" * 70)
# Test 1: Agent initialization
test1_passed = test_agent_initialization()
# Test 2: Simple question processing
test2_passed = test_simple_question()
print("\n" + "=" * 70)
print("π Test Results:")
print(f" Agent Initialization: {'β
PASSED' if test1_passed else 'β FAILED'}")
print(f" Simple Question: {'β
PASSED' if test2_passed else 'β FAILED'}")
if test1_passed and test2_passed:
print("\nπ All tests passed! Enhanced agent with European multimodal tools is working!")
return True
else:
print("\nβ οΈ Some tests failed. Check the logs above for details.")
return False
if __name__ == "__main__":
success = main()
sys.exit(0 if success else 1) |