refactor: Fix code quality issues identified in analysis
1. Rename factory.py's EvoAgent data class to AgentConfig - Avoids naming conflict with base/evo_agent.py's EvoAgent 2. Export pipeline_runner functions in backend/core/__init__.py - Add create_agents, create_long_term_memory, stop_gateway 3. Consolidate PromptLoader to singleton pattern - Add get_prompt_loader() singleton function - Update all usages to use singleton Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,17 @@ from typing import Any, Dict, Optional
|
||||
|
||||
import yaml
|
||||
|
||||
# Singleton instance
|
||||
_prompt_loader_instance: Optional["PromptLoader"] = None
|
||||
|
||||
|
||||
def get_prompt_loader() -> "PromptLoader":
|
||||
"""Get the singleton PromptLoader instance."""
|
||||
global _prompt_loader_instance
|
||||
if _prompt_loader_instance is None:
|
||||
_prompt_loader_instance = PromptLoader()
|
||||
return _prompt_loader_instance
|
||||
|
||||
|
||||
class PromptLoader:
|
||||
"""Unified Prompt loader"""
|
||||
|
||||
Reference in New Issue
Block a user