Skip to main content
Glama

MCP Agent Tracker

by Big0290
test_conversation_context.pyโ€ข5.54 kB
#!/usr/bin/env python3 """ ๐Ÿงช Test Script: Verify Conversation Context Inclusion for General Questions """ def test_conversation_context_inclusion(): """Test if conversation context is included for general questions""" print("๐Ÿงช TESTING CONVERSATION CONTEXT INCLUSION FOR GENERAL QUESTIONS") print("=" * 70) try: # Test 1: Import optimized prompt generator print("1๏ธโƒฃ Testing optimized prompt generator import...") from optimized_prompt_generator import OptimizedPromptGenerator generator = OptimizedPromptGenerator() print("โœ… OptimizedPromptGenerator imported successfully") # Test 2: Create test context with all sections print("\n2๏ธโƒฃ Testing context with all sections...") from prompt_generator import PromptContext # Create test context with all sections test_context = PromptContext( conversation_summary="Test conversation summary with interactions", action_history="Test action history with recent actions", tech_stack="Test tech stack", project_plans="๐ŸŽฏ PROJECT PLANS & OBJECTIVES:\n1. Build powerful conversation tracking system โœ…\n2. Implement context-aware prompt processing โœ…\n3. Create intelligent memory management system โœ…", user_preferences="Test user preferences", agent_metadata="Test agent metadata", recent_interactions=[], project_patterns=[], best_practices=[], common_issues=[], development_workflow=[], confidence_score=0.9, context_type="test" ) print("โœ… Test context created with all sections") # Test 3: Test context conversion print("\n3๏ธโƒฃ Testing context conversion...") context_dict = generator._context_to_dict(test_context) print(f"โœ… Context converted to dict") print(f"๐Ÿ“‹ Available keys: {list(context_dict.keys())}") print(f"๐Ÿ’ฌ Conversation summary: {'conversation_summary' in context_dict}") print(f"๐Ÿ“ Action history: {'action_history' in context_dict}") print(f"๐ŸŽฏ Project plans: {'project_plans' in context_dict}") # Test 4: Test intent classification for general question print("\n4๏ธโƒฃ Testing intent classification for general question...") if generator.intent_selector: relevant_context, intent_analysis = generator.intent_selector.select_relevant_context( "test to see if we now get conversation context for general questions", context_dict ) print(f"โœ… Intent classified successfully") print(f"๐ŸŽฏ Intent: {intent_analysis.primary_intent.value}") print(f"๐Ÿ“‹ Context requirements: {intent_analysis.context_requirements}") print(f"๐Ÿ”ง Selected context: {list(relevant_context.keys())}") else: print("โš ๏ธ Intent selector not available") # Test 5: Test conversation context formatting print("\n5๏ธโƒฃ Testing conversation context formatting...") conversation_context = generator._format_phase1_conversation_context(context_dict) print(f"โœ… Conversation context formatted") print(f"๐Ÿ“‹ Result length: {len(conversation_context)}") print(f"๐Ÿ’ฌ Contains context: {'๐Ÿ’ฌ CONTEXT:' in conversation_context}") print(f"๐Ÿ“ Contains recent: {'๐Ÿ“ RECENT:' in conversation_context}") print(f"๐ŸŽฏ Contains goals: {'๐ŸŽฏ GOALS:' in conversation_context}") print(f"๐Ÿ“‹ Formatted result:\n{conversation_context}") # Test 6: Test full prompt generation print("\n6๏ธโƒฃ Testing full prompt generation...") try: full_prompt = generator._create_phase1_optimized_prompt( "test to see if we now get conversation context for general questions", test_context, "smart" ) print(f"โœ… Full prompt generated") print(f"๐Ÿ“‹ Prompt length: {len(full_prompt)}") print(f"๐Ÿ’ฌ Contains context: {'๐Ÿ’ฌ CONTEXT:' in full_prompt}") print(f"๐Ÿ“ Contains recent: {'๐Ÿ“ RECENT:' in full_prompt}") print(f"๐ŸŽฏ Contains goals: {'๐ŸŽฏ GOALS:' in full_prompt}") print(f"๐Ÿ“‹ Prompt preview:\n{full_prompt[:500]}...") except Exception as e: print(f"โŒ Full prompt generation failed: {e}") print("\n" + "=" * 70) print("๐Ÿงช TEST COMPLETE") # Final assessment if '๐Ÿ’ฌ CONTEXT:' in conversation_context and '๐Ÿ“ RECENT:' in conversation_context and '๐ŸŽฏ GOALS:' in conversation_context: print("๐ŸŽ‰ SUCCESS: All conversation context sections are now included!") else: print("โŒ FAILURE: Some conversation context sections are still missing!") if '๐Ÿ’ฌ CONTEXT:' not in conversation_context: print(" โŒ Missing: ๐Ÿ’ฌ CONTEXT") if '๐Ÿ“ RECENT:' not in conversation_context: print(" โŒ Missing: ๐Ÿ“ RECENT") if '๐ŸŽฏ GOALS:' not in conversation_context: print(" โŒ Missing: ๐ŸŽฏ GOALS") except Exception as e: print(f"โŒ Error during testing: {e}") import traceback traceback.print_exc() if __name__ == "__main__": test_conversation_context_inclusion()

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Big0290/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server