Skip to content

Commit

Permalink
[ISSUE] State messages should return a full log of code and attempt t…
Browse files Browse the repository at this point in the history
…o answer question #26
  • Loading branch information
mdancho84 committed Jan 18, 2025
1 parent 627027b commit ee33419
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ai_data_science_team/multiagents/sql_data_analyst.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,22 @@ def get_workflow_summary(self, markdown=False):
If True, returns the summary as a Markdown-formatted string.
"""
if self.response and self.get_response()['messages']:

agents = [self.get_response()['messages'][i].role for i in range(len(self.get_response()['messages']))]

agent_labels = []
for i in range(len(agents)):
agent_labels.append(f"- **Agent {i+1}:** {agents[i]}")

# Construct header
header = f"# SQL Data Analyst Workflow Summary Report\n\nThis agentic workflow contains {len(agents)} agents:\n\n" + "\n".join(agent_labels)

reports = []
for msg in self.get_response()['messages']:
reports.append(get_generic_summary(json.loads(msg.content)))

if markdown:
return Markdown("\n\n".join(reports))
return Markdown(header + "\n\n".join(reports))
return "\n\n".join(reports)


Expand Down

0 comments on commit ee33419

Please sign in to comment.