@@ -93,7 +93,7 @@ def __init__(
9393 AgentType .HUMAN .value ,
9494 AgentType .HR .value ,
9595 AgentType .MARKETING .value ,
96- AgentType .PRODUCT ,
96+ AgentType .PRODUCT . value ,
9797 AgentType .PROCUREMENT .value ,
9898 AgentType .TECH_SUPPORT .value ,
9999 AgentType .GENERIC .value ,
@@ -105,48 +105,6 @@ def __init__(
105105 # This will be initialized in async_init
106106 self ._azure_ai_agent = None
107107
108- def _get_response_format_schema (self ) -> dict :
109- """
110- Returns a JSON schema that defines the expected structure of the response.
111- This ensures responses from the agent will match the required format exactly.
112- """
113- return {
114- "type" : "object" ,
115- "properties" : {
116- "initial_goal" : {
117- "type" : "string" ,
118- "description" : "The primary goal extracted from the user's input task" ,
119- },
120- "steps" : {
121- "type" : "array" ,
122- "description" : "List of steps required to complete the task" ,
123- "items" : {
124- "type" : "object" ,
125- "properties" : {
126- "action" : {
127- "type" : "string" ,
128- "description" : "A clear instruction for the agent including the function name to use" ,
129- },
130- "agent" : {
131- "type" : "string" ,
132- "description" : "The name of the agent responsible for this step" ,
133- },
134- },
135- "required" : ["action" , "agent" ],
136- },
137- },
138- "summary_plan_and_steps" : {
139- "type" : "string" ,
140- "description" : "A concise summary of the overall plan and its steps in less than 50 words" ,
141- },
142- "human_clarification_request" : {
143- "type" : ["string" , "null" ],
144- "description" : "Optional request for additional information needed from the user" ,
145- },
146- },
147- "required" : ["initial_goal" , "steps" , "summary_plan_and_steps" ],
148- }
149-
150108 async def async_init (self ) -> None :
151109 """Asynchronously initialize the PlannerAgent.
152110
@@ -331,12 +289,12 @@ async def _create_structured_plan(
331289 try :
332290 # Generate the instruction for the LLM
333291 logging .info ("Generating instruction for the LLM" )
334- logging .debug (f"Input: { input_task } " )
335- logging .debug (f"Available agents: { self ._available_agents } " )
292+ logging .info (f"Input: { input_task } " )
293+ logging .info (f"Available agents: { self ._available_agents } " )
336294
337295 # Get template variables as a dictionary
338296 args = self ._generate_args (input_task .description )
339-
297+ logging . info ( f"Generated args: { args } " )
340298 logging .info (f"Creating plan for task: '{ input_task .description } '" )
341299 logging .info (f"Using available agents: { self ._available_agents } " )
342300
@@ -355,10 +313,10 @@ async def _create_structured_plan(
355313 kernel_args = KernelArguments (** args )
356314 # kernel_args["input"] = f"TASK: {input_task.description}\n\n{instruction}"
357315
358- logging .debug (f"Kernel arguments: { kernel_args } " )
316+ logging .info (f"Kernel arguments: { kernel_args } " )
359317
360318 # Get the schema for our expected response format
361- response_format_schema = self . _get_response_format_schema ()
319+
362320
363321 # Ensure we're using the right pattern for Azure AI agents with semantic kernel
364322 # Properly handle async generation
@@ -367,10 +325,6 @@ async def _create_structured_plan(
367325 settings = {
368326 "temperature" : 0.0 , # Keep temperature low for consistent planning
369327 "max_tokens" : 10096 , # Ensure we have enough tokens for the full plan
370- "response_format" : {
371- "type" : "json_object" ,
372- "schema" : response_format_schema ,
373- },
374328 },
375329 )
376330
@@ -382,8 +336,9 @@ async def _create_structured_plan(
382336 if chunk is not None :
383337 response_content += str (chunk )
384338
339+ logging .info (f"\n \n \n \n " )
385340 logging .info (f"Response content length: { len (response_content )} " )
386- logging .debug (f"Response content: { response_content [: 500 ] } ... " )
341+ logging .info (f"\n \n \n \n " )
387342
388343 # Check if response is empty or whitespace
389344 if not response_content or response_content .isspace ():
@@ -398,6 +353,9 @@ async def _create_structured_plan(
398353 try :
399354 parsed_result = PlannerResponsePlan .parse_raw (response_content )
400355 logging .info ("Successfully parsed response with direct parsing" )
356+ logging .info (f"\n \n \n \n " )
357+ logging .info (f"Parsed result: { parsed_result } " )
358+ logging .info (f"\n \n \n \n " )
401359 except Exception as parse_error :
402360 logging .warning (f"Failed direct parse: { parse_error } " )
403361
@@ -727,6 +685,7 @@ def _generate_args(self, objective: str) -> any:
727685 if hasattr (self , "_agent_instances" ) and self ._agent_instances :
728686 # Process each agent to get their tools
729687 for agent_name , agent in self ._agent_instances .items ():
688+
730689 if hasattr (agent , "_tools" ) and agent ._tools :
731690 # Add each tool from this agent
732691 for tool in agent ._tools :
@@ -814,7 +773,7 @@ def _generate_args(self, objective: str) -> any:
814773
815774 tools_list .append (tool_entry )
816775
817- logging .debug (f"Generated { len (tools_list )} tools from agent instances" )
776+ logging .info (f"Generated { len (tools_list )} tools from agent instances" )
818777
819778 # If we couldn't extract tools from agent instances, create a simplified format
820779 if not tools_list :
@@ -833,7 +792,7 @@ def _generate_args(self, objective: str) -> any:
833792 # Extract agent name if format is "Agent: AgentName"
834793 agent_name = agent_part .replace ("Agent" , "" ).strip ()
835794 if not agent_name :
836- agent_name = "GenericAgent"
795+ agent_name = AgentType . GENERIC . value
837796
838797 tools_list .append (
839798 {
0 commit comments