File size: 2,295 Bytes
2773c7a |
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 |
import sys
import asyncio
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent
sys.path.append(str(project_root))
from core.coordinator import coordinator
from core.session import session_manager
async def test_enhanced_features():
"""Test the enhanced UI and coordination features"""
print("=== Enhanced Features Test ===")
print()
# Test user query
user_query = "What are the benefits of meditation for stress management?"
user_id = "test_user"
print(f"User Query: {user_query}")
print()
# Test enhanced coordination with detailed tracking
print("1. Testing Enhanced Coordination with Detailed Tracking:")
try:
print(" Starting enhanced coordination...")
response_count = 0
async for response_chunk in coordinator.coordinate_hierarchical_conversation(user_id, user_query):
response_count += 1
print(f" Chunk {response_count}:")
print(f" Type: {response_chunk['type']}")
print(f" Content: {response_chunk['content'][:100]}...")
if 'details' in response_chunk:
print(f" Details: {response_chunk['details']}")
print()
# Limit output for readability
if response_count >= 8:
print(" ... (truncated for brevity)")
break
print(" β
Enhanced Coordination Test Passed")
except Exception as e:
print(f" β Enhanced Coordination Test Failed: {e}")
print()
# Test coordination status
print("2. Testing Coordination Status:")
try:
coord_status = coordinator.get_coordination_status()
print(f" Tavily Available: {coord_status.get('tavily_available', False)}")
print(f" Weather Available: {coord_status.get('weather_available', False)}")
print(f" Web Search Enabled: {coord_status.get('web_search_enabled', False)}")
print(" β
Coordination Status Check Passed")
except Exception as e:
print(f" β Coordination Status Check Failed: {e}")
print()
print("π Enhanced Features Test Completed!")
if __name__ == "__main__":
asyncio.run(test_enhanced_features())
|