Spaces:
Running
Running
#!/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) |