Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/agents/extensions/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ def get_all_nodes(
name = _escape_label(handoff.agent_name)
parts.append(
f'"{name}" [label="{name}", '
f"shape=box, style=filled, style=rounded, "
f'shape=box, style="filled,rounded", '
f"fillcolor=lightyellow, width=1.5, height=0.8];"
)
if isinstance(handoff, Agent):
if handoff.name not in visited:
name = _escape_label(handoff.name)
parts.append(
f'"{name}" [label="{name}", '
f"shape=box, style=filled, style=rounded, "
f'shape=box, style="filled,rounded", '
f"fillcolor=lightyellow, width=1.5, height=0.8];"
)
parts.append(get_all_nodes(handoff, agent, visited))
Expand Down
8 changes: 4 additions & 4 deletions tests/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_get_main_graph(mock_agent):
"fillcolor=lightgreen, width=0.5, height=0.3];" in result
)
assert (
'"Handoff1" [label="Handoff1", shape=box, style=filled, style=rounded, '
'"Handoff1" [label="Handoff1", shape=box, style="filled,rounded", '
"fillcolor=lightyellow, width=1.5, height=0.8];" in result
)
_assert_mcp_nodes(result)
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_get_all_nodes(mock_agent):
"fillcolor=lightgreen, width=0.5, height=0.3];" in result
)
assert (
'"Handoff1" [label="Handoff1", shape=box, style=filled, style=rounded, '
'"Handoff1" [label="Handoff1", shape=box, style="filled,rounded", '
"fillcolor=lightyellow, width=1.5, height=0.8];" in result
)
_assert_mcp_nodes(result)
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_draw_graph(mock_agent):
"fillcolor=lightgreen, width=0.5, height=0.3];" in graph.source
)
assert (
'"Handoff1" [label="Handoff1", shape=box, style=filled, style=rounded, '
'"Handoff1" [label="Handoff1", shape=box, style="filled,rounded", '
"fillcolor=lightyellow, width=1.5, height=0.8];" in graph.source
)
_assert_mcp_nodes(graph.source)
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_draw_graph_with_real_handoff_object():
assert '"ParentAgent"' in graph.source
# Node uses agent_name from the Handoff object
assert (
'"ChildAgent" [label="ChildAgent", shape=box, style=filled, style=rounded, '
'"ChildAgent" [label="ChildAgent", shape=box, style="filled,rounded", '
"fillcolor=lightyellow, width=1.5, height=0.8];" in graph.source
)
# Edge points from parent to handoff agent_name
Expand Down