- Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: Add Graphviz-based agent visualization functionality #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5865c6f cecdcd0 9b972b3 2993d26 29e9983 e984274 aff1d60 f7c594d 6f2f729 c745fe1 53367be 39ff00d 0079bca b7627cb f4edc1f 9f7d596 a5b7abe 623063b 900a97f b3addcf 9d04671 48fad9e 57ecebf 698fd69 6be9b2a 59aed34 2f2606e d8922ff b9d32cd 29103ca 5ad53d8 351b607 3068e42 70aff1d c16deb2 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -42,21 +42,24 @@ def get_all_nodes(agent: Agent, parent: Agent = None) -> str: | |
| parts = [] | ||
| # Ensure parent agent node is colored | ||
| if not parent: | ||
| parts.append(f""" | ||
| "{agent.name}" [label="{agent.name}", shape=box, style=filled, | ||
| fillcolor=lightyellow, width=1.5, height=0.8];""") | ||
| parts.append( | ||
| f'"{agent.name}" [label="{agent.name}", shape=box, style=filled, ' | ||
| 'fillcolor=lightyellow, width=1.5, height=0.8];' | ||
| ) | ||
| | ||
| # Smaller tools (ellipse, green) | ||
| for tool in agent.tools: | ||
| parts.append(f""" | ||
| "{tool.name}" [label="{tool.name}", shape=ellipse, style=filled, | ||
| fillcolor=lightgreen, width=0.5, height=0.3];""") | ||
| parts.append( | ||
| f'"{tool.name}" [label="{tool.name}", shape=ellipse, style=filled, ' | ||
| f'fillcolor=lightgreen, width=0.5, height=0.3];' | ||
| ) | ||
| | ||
| # Bigger handoffs (rounded box, yellow) | ||
| for handoff in agent.handoffs: | ||
| parts.append(f""" | ||
| "{handoff.name}" [label="{handoff.name}", shape=box, style=filled, | ||
| style=rounded, fillcolor=lightyellow, width=1.5, height=0.8];""") | ||
| parts.append( | ||
| f'"{handoff.name}" [label="{handoff.name}", shape=box, style=filled, style=rounded, ' | ||
| f'fillcolor=lightyellow, width=1.5, height=0.8];' | ||
| ) | ||
| parts.append(get_all_nodes(handoff)) | ||
| ||
| | ||
| return "".join(parts) | ||
| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want
handoff.agent_namenothandoff.name, if it's aHandoffinstanceThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added isinstance check.