#!/usr/bin/env python3
"""
Test script for the enhanced Gemini MCP implementation with real LLM-based tool selection.
Limited to 6 queries to respect free tier limits.
"""
import asyncio
import sys
import os
import logging
# Add the src directory to the Python path
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
async def test_enhanced_implementation():
"""Test the enhanced implementation with real LLM-based tool selection."""
try:
from src.client.main import EnhancedGeminiMCPClient
logger.info("Testing enhanced Gemini MCP implementation...")
# Initialize the enhanced client
client = EnhancedGeminiMCPClient("src/server/main.py")
# Test queries that should trigger different tools (limited to 6 for free tier)
test_queries = [
"What is the company's vacation policy?",
"Calculate 15 + 27 * 3",
"What's the weather in New York?",
"How many sick days do employees get?",
"What is the absolute value of -42?",
"What benefits does the company offer?"
]
logger.info("Running batch test with LLM-based tool selection (6 queries)...")
await client.run_batch_queries(test_queries)
logger.info("Enhanced implementation test completed successfully!")
except Exception as e:
logger.error(f"Error testing enhanced implementation: {e}")
raise
if __name__ == "__main__":
asyncio.run(test_enhanced_implementation())