Add Senior Research Analyst feature with R&D pipeline focus - New ResearchAnalystAgent for extracting high-value insights - 4 specialized research prompts for experiments, prototypes, and product decisions - Enhanced UI with dedicated research analysis tab - Streaming support and export functionality - Non-breaking integration preserving all existing workflows
59de368
| #!/usr/bin/env python3 | |
| """ | |
| Test script for the new Senior Research Analyst feature | |
| """ | |
| def test_imports(): | |
| """Test that all new components can be imported""" | |
| try: | |
| from agents import ResearchAnalystAgent, MasterOrchestrator | |
| print("β ResearchAnalystAgent imported successfully") | |
| from config import Config | |
| print("β Config imported successfully") | |
| from utils.prompts import PromptManager | |
| print("β PromptManager imported successfully") | |
| return True | |
| except ImportError as e: | |
| print(f"β Import error: {e}") | |
| return False | |
| def test_agent_initialization(): | |
| """Test that the ResearchAnalystAgent can be initialized""" | |
| try: | |
| from agents import ResearchAnalystAgent | |
| from config import Config | |
| agent = ResearchAnalystAgent(name='TestResearchAgent', model=Config.OPENAI_MODEL) | |
| print("β ResearchAnalystAgent initialized successfully") | |
| return True | |
| except Exception as e: | |
| print(f"β Agent initialization error: {e}") | |
| return False | |
| def test_research_prompts(): | |
| """Test that research prompts are available""" | |
| try: | |
| from utils.prompts import PromptManager | |
| pm = PromptManager() | |
| all_prompts = pm.get_all_prompts() | |
| research_prompts = [pid for pid, prompt in all_prompts.items() if prompt.get('category') == 'research'] | |
| print(f"β Found {len(research_prompts)} research prompts:") | |
| for prompt_id in research_prompts: | |
| prompt_info = all_prompts[prompt_id] | |
| print(f" - {prompt_id}: {prompt_info['name']}") | |
| return len(research_prompts) > 0 | |
| except Exception as e: | |
| print(f"β Research prompts test error: {e}") | |
| return False | |
| def test_orchestrator_integration(): | |
| """Test that the orchestrator can handle research targets""" | |
| try: | |
| from agents import ResearchAnalystAgent, MasterOrchestrator | |
| from config import Config | |
| # Create agents dict with research agent | |
| agents = { | |
| "research": ResearchAnalystAgent(name="ResearchAnalystAgent", model=Config.OPENAI_MODEL) | |
| } | |
| orchestrator = MasterOrchestrator(agents=agents) | |
| print("β MasterOrchestrator initialized with research agent") | |
| return True | |
| except Exception as e: | |
| print(f"β Orchestrator integration error: {e}") | |
| return False | |
| def main(): | |
| """Run all tests""" | |
| print("π§ͺ Testing Senior Research Analyst Feature Implementation") | |
| print("=" * 60) | |
| tests = [ | |
| ("Import Tests", test_imports), | |
| ("Agent Initialization", test_agent_initialization), | |
| ("Research Prompts", test_research_prompts), | |
| ("Orchestrator Integration", test_orchestrator_integration), | |
| ] | |
| results = [] | |
| for test_name, test_func in tests: | |
| print(f"\nπ Running {test_name}...") | |
| result = test_func() | |
| results.append((test_name, result)) | |
| print("\n" + "=" * 60) | |
| print("π Test Results Summary:") | |
| all_passed = True | |
| for test_name, result in results: | |
| status = "β PASS" if result else "β FAIL" | |
| print(f" {status} {test_name}") | |
| if not result: | |
| all_passed = False | |
| print("\n" + "=" * 60) | |
| if all_passed: | |
| print("π All tests passed! Senior Research Analyst feature is ready.") | |
| print("\nπ New Features Available:") | |
| print(" - Senior Research Analyst Agent with R&D pipeline focus") | |
| print(" - 4 specialized research prompts") | |
| print(" - Dedicated research analysis tab in UI") | |
| print(" - Streaming support for research analysis") | |
| print(" - Export functionality for research results") | |
| else: | |
| print("β οΈ Some tests failed. Please check the implementation.") | |
| return all_passed | |
| if __name__ == "__main__": | |
| main() | |