88from semantic_kernel .agents .azure_ai .azure_ai_agent import AzureAIAgent
99import inspect
1010
11- from models .agent_types import AgentType
1211from kernel_agents .agent_base import BaseAgent
1312# Import the new AppConfig instance
1413from app_config import config
2524from kernel_agents .group_chat_manager import GroupChatManager
2625from semantic_kernel .prompt_template .prompt_template_config import PromptTemplateConfig
2726from context .cosmos_memory_kernel import CosmosMemoryContext
28- from models .messages_kernel import PlannerResponsePlan
27+ from models .messages_kernel import PlannerResponsePlan , AgentType
2928
3029from azure .ai .projects .models import (
3130 ResponseFormatJsonSchema ,
@@ -46,21 +45,21 @@ class AgentFactory:
4645 AgentType .TECH_SUPPORT : TechSupportAgent ,
4746 AgentType .GENERIC : GenericAgent ,
4847 AgentType .HUMAN : HumanAgent ,
49- AgentType .PLANNER : PlannerAgent , # Add PlannerAgent
48+ AgentType .PLANNER : PlannerAgent ,
5049 AgentType .GROUP_CHAT_MANAGER : GroupChatManager , # Add GroupChatManager
5150 }
5251
5352 # Mapping of agent types to their string identifiers (for automatic tool loading)
5453 _agent_type_strings : Dict [AgentType , str ] = {
55- AgentType .HR : "hr" ,
56- AgentType .MARKETING : "marketing" ,
57- AgentType .PRODUCT : "product" ,
58- AgentType .PROCUREMENT : "procurement" ,
59- AgentType .TECH_SUPPORT : "tech_support" ,
60- AgentType .GENERIC : "generic" ,
61- AgentType .HUMAN : "human" ,
62- AgentType .PLANNER : "planner" , # Add planner
63- AgentType .GROUP_CHAT_MANAGER : "group_chat_manager" , # Add group_chat_manager
54+ AgentType .HR : AgentType . HR . value ,
55+ AgentType .MARKETING : AgentType . MARKETING . value ,
56+ AgentType .PRODUCT : AgentType . PRODUCT . value ,
57+ AgentType .PROCUREMENT : AgentType . PROCUREMENT . value ,
58+ AgentType .TECH_SUPPORT :AgentType . TECH_SUPPORT . value ,
59+ AgentType .GENERIC : AgentType . GENERIC . value ,
60+ AgentType .HUMAN : AgentType . HUMAN . value ,
61+ AgentType .PLANNER : AgentType . PLANNER . value ,
62+ AgentType .GROUP_CHAT_MANAGER : AgentType . GROUP_CHAT_MANAGER . value ,
6463 }
6564
6665 # System messages for each agent type
@@ -255,23 +254,14 @@ async def _load_tools_for_agent(cls, kernel: Kernel, agent_type: str) -> List[Ke
255254 except Exception as e :
256255 logger .warning (f"Error loading tools for { agent_type } : { e } " )
257256
258- # Return an empty list for agents without tools rather than attempting a fallback
259- # Special handling for group_chat_manager which typically doesn't need tools
260- if "group_chat_manager" in agent_type :
261- logger .info (f"No tools needed for { agent_type } . Returning empty list." )
262- return []
263-
257+
264258 # For other agent types, try to create a simple fallback tool
265259 try :
266260 # Use PromptTemplateConfig to create a simple tool
267261
268262
269263 # Simple minimal prompt
270- prompt = f"""You are a helpful assistant specialized in { agent_type } tasks.
271-
272- User query: {{$input}}
273-
274- Provide a helpful response."""
264+ prompt = f"""You are a helpful assistant specialized in { agent_type } tasks. User query: {{$input}} Provide a helpful response."""
275265
276266 # Create a prompt template config
277267 prompt_config = PromptTemplateConfig (
0 commit comments