1010from semantic_kernel .agents import Agent
1111from semantic_kernel .agents .orchestration .magentic import (
1212 MagenticContext , StandardMagenticManager )
13+ from semantic_kernel .agents .orchestration .prompts ._magentic_prompts import \
14+ ORCHESTRATOR_TASK_LEDGER_FACTS_PROMPT
1315from semantic_kernel .contents import ChatMessageContent
1416from v3 .config .settings import connection_config , current_user_id
1517from v3 .models .models import MPlan , MStep
@@ -28,10 +30,22 @@ class HumanApprovalMagenticManager(StandardMagenticManager):
2830
2931 def __init__ (self , * args , ** kwargs ):
3032 # Remove any custom kwargs before passing to parent
31- super (). __init__ ( * args , ** kwargs )
33+
3234 # Use object.__setattr__ to bypass Pydantic validation
3335 # object.__setattr__(self, 'current_user_id', None)
36+
37+ custom_addition = """
38+
39+ ADDITIONAL INSTRUCTIONS:
40+ To address this request we have assembled the following team:
41+
42+ {{$team}}
43+
44+ Please check with the team members to list all relevant tools they have access to, and their required parameters."""
45+
46+ kwargs ['task_ledger_facts_prompt' ] = ORCHESTRATOR_TASK_LEDGER_FACTS_PROMPT + custom_addition
3447
48+ super ().__init__ (* args , ** kwargs )
3549
3650 async def plan (self , magentic_context : MagenticContext ) -> Any :
3751 """
@@ -44,12 +58,12 @@ async def plan(self, magentic_context: MagenticContext) -> Any:
4458 elif not isinstance (task_text , str ):
4559 task_text = str (task_text )
4660
47- print (f"\n 🎯 Human-in-the-Loop Magentic Manager Creating Plan:" )
61+ print (f"\n Human-in-the-Loop Magentic Manager Creating Plan:" )
4862 print (f" Task: { task_text } " )
4963 print ("-" * 60 )
5064
5165 # First, let the parent create the actual plan
52- print ("📋 Creating execution plan..." )
66+ print (" Creating execution plan..." )
5367 plan = await super ().plan (magentic_context )
5468 self .magentic_plan = self .plan_to_obj ( magentic_context , self .task_ledger )
5569
@@ -110,19 +124,19 @@ async def prepare_final_answer(self, magentic_context: MagenticContext) -> ChatM
110124 """
111125 Override to ensure final answer is prepared after all steps are executed.
112126 """
113- print ("\n 📝 Magentic Manager - Preparing final answer..." )
127+ print ("\n Magentic Manager - Preparing final answer..." )
114128
115129 return await super ().prepare_final_answer (magentic_context )
116130
117131 async def _get_plan_approval_with_details (self , task : str , participant_descriptions : dict , plan : Any ) -> bool :
118132 while True :
119- approval = input ("\n ❓ Approve this execution plan? [y/n/details]: " ).strip ().lower ()
133+ approval = input ("\ Approve this execution plan? [y/n/details]: " ).strip ().lower ()
120134
121135 if approval in ['y' , 'yes' ]:
122- print ("✅ Plan approved by user" )
136+ print (" Plan approved by user" )
123137 return True
124138 elif approval in ['n' , 'no' ]:
125- print ("❌ Plan rejected by user" )
139+ print (" Plan rejected by user" )
126140 return False
127141 # elif approval in ['d', 'details']:
128142 # self._show_detailed_plan_info(task, participant_descriptions, plan)
0 commit comments