Skip to content

Commit ee33419

Browse files
committed
[ISSUE] State messages should return a full log of code and attempt to answer question #26
1 parent 627027b commit ee33419

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ai_data_science_team/multiagents/sql_data_analyst.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,22 @@ def get_workflow_summary(self, markdown=False):
298298
If True, returns the summary as a Markdown-formatted string.
299299
"""
300300
if self.response and self.get_response()['messages']:
301+
302+
agents = [self.get_response()['messages'][i].role for i in range(len(self.get_response()['messages']))]
303+
304+
agent_labels = []
305+
for i in range(len(agents)):
306+
agent_labels.append(f"- **Agent {i+1}:** {agents[i]}")
307+
308+
# Construct header
309+
header = f"# SQL Data Analyst Workflow Summary Report\n\nThis agentic workflow contains {len(agents)} agents:\n\n" + "\n".join(agent_labels)
310+
301311
reports = []
302312
for msg in self.get_response()['messages']:
303313
reports.append(get_generic_summary(json.loads(msg.content)))
314+
304315
if markdown:
305-
return Markdown("\n\n".join(reports))
316+
return Markdown(header + "\n\n".join(reports))
306317
return "\n\n".join(reports)
307318

308319

0 commit comments

Comments
 (0)