@@ -89,9 +89,11 @@ async def get_database_metrics(
8989 # Clean up
9090 project_client .agents .threads .delete (thread_id = thread .id )
9191
92- except Exception :
92+ except Exception as e :
93+ print (f"Exception during database metrics retrieval from get_database_metrics: { e } " )
9394 answer = 'Details could not be retrieved. Please try again later.'
9495
96+ print (f"Response from Plugin: Database metrics from get_database_metrics : %s" , answer )
9597 return answer
9698
9799 @kernel_function (name = "GetCallInsights" , description = "Provides summaries, explanations, and insights from customer call transcripts." )
@@ -163,8 +165,10 @@ def replace_marker(match):
163165 answer ["answer" ] = convert_citation_markers (answer ["answer" ])
164166 break
165167 project_client .agents .threads .delete (thread_id = thread .id )
166- except Exception :
168+ except Exception as e :
169+ print (f"Error in get_call_insights: %s" , e )
167170 return "Details could not be retrieved. Please try again later."
171+ print (f"Response from Plugin: Call insights data from get_call_insights : %s" , answer )
168172 return answer
169173
170174 @kernel_function (name = "GenerateChartData" , description = "Generates Chart.js v4.4.4 compatible JSON data for data visualization requests using current and immediate previous context." )
@@ -174,8 +178,13 @@ async def generate_chart_data(
174178 ):
175179 query = input
176180 query = query .strip ()
181+ print (f"Chart generation started for query: { query } " )
182+
177183 try :
184+ print ("Fetching chart agent from factory..." )
178185 agent_info = await ChartAgentFactory .get_agent ()
186+ print (f"Chart agent retrieved successfully. Agent ID: { agent_info ['agent' ].id if agent_info .get ('agent' ) else 'Unknown' } " )
187+
179188 agent = agent_info ["agent" ]
180189 project_client = agent_info ["client" ]
181190
@@ -193,7 +202,8 @@ async def generate_chart_data(
193202 )
194203
195204 if run .status == "failed" :
196- print (f"Run failed: { run .last_error } " )
205+ print (f"Chart generation run failed: { run .last_error } " )
206+ print (f"Run details - ID: { run .id } , Thread ID: { thread .id } " )
197207 return "Details could not be retrieved. Please try again later."
198208
199209 chartdata = ""
@@ -205,6 +215,8 @@ async def generate_chart_data(
205215 # Clean up
206216 project_client .agents .threads .delete (thread_id = thread .id )
207217
208- except Exception :
218+ except Exception as e :
219+ print (f"Exception during chart data generation from generate_chart_data: { e } " )
209220 chartdata = 'Details could not be retrieved. Please try again later.'
221+ print (f"Response from Plugin: Chart data from generate_chart_data : %s" , chartdata )
210222 return chartdata
0 commit comments