Skip to content

Commit b7627cb

Browse files
committed
style: improve string formatting
1 parent 0079bca commit b7627cb

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/agents/extensions/visualization.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,24 @@ def get_all_nodes(agent: Agent, parent: Agent = None) -> str:
4242
parts = []
4343
# Ensure parent agent node is colored
4444
if not parent:
45-
parts.append(f"""
46-
"{agent.name}" [label="{agent.name}", shape=box, style=filled,
47-
fillcolor=lightyellow, width=1.5, height=0.8];""")
45+
parts.append(
46+
f'"{agent.name}" [label="{agent.name}", shape=box, style=filled, '
47+
'fillcolor=lightyellow, width=1.5, height=0.8];'
48+
)
4849

4950
# Smaller tools (ellipse, green)
5051
for tool in agent.tools:
51-
parts.append(f"""
52-
"{tool.name}" [label="{tool.name}", shape=ellipse, style=filled,
53-
fillcolor=lightgreen, width=0.5, height=0.3];""")
52+
parts.append(
53+
f'"{tool.name}" [label="{tool.name}", shape=ellipse, style=filled, '
54+
f'fillcolor=lightgreen, width=0.5, height=0.3];'
55+
)
5456

5557
# Bigger handoffs (rounded box, yellow)
5658
for handoff in agent.handoffs:
57-
parts.append(f"""
58-
"{handoff.name}" [label="{handoff.name}", shape=box, style=filled,
59-
style=rounded, fillcolor=lightyellow, width=1.5, height=0.8];""")
59+
parts.append(
60+
f'"{handoff.name}" [label="{handoff.name}", shape=box, style=filled, style=rounded, '
61+
f'fillcolor=lightyellow, width=1.5, height=0.8];'
62+
)
6063
parts.append(get_all_nodes(handoff))
6164

6265
return "".join(parts)

0 commit comments

Comments
 (0)