From b7627cb642e3cc50fc95d35b387e1b62870fec00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Bravo?= <123977407+MartinEBravo@users.noreply.github.com> Date: Tue, 18 Mar 2025 10:14:52 +0100 Subject: [PATCH] style: improve string formatting --- src/agents/extensions/visualization.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/agents/extensions/visualization.py b/src/agents/extensions/visualization.py index 985731b..1b5b7e5 100644 --- a/src/agents/extensions/visualization.py +++ b/src/agents/extensions/visualization.py @@ -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)