MCPcopy Index your code
hub / github.com/google/adk-python / get_node_name

Function get_node_name

src/google/adk/cli/agent_graph.py:66–82  ·  view source on GitHub ↗
(tool_or_agent: Union[BaseAgent, BaseTool])

Source from the content-addressed store, hash-verified

64 white = '#ffffff'
65
66 def get_node_name(tool_or_agent: Union[BaseAgent, BaseTool]):
67 if isinstance(tool_or_agent, BaseAgent):
68 # Added Workflow Agent checks for different agent types
69 if isinstance(tool_or_agent, SequentialAgent):
70 return tool_or_agent.name + ' (Sequential Agent)'
71 elif isinstance(tool_or_agent, LoopAgent):
72 return tool_or_agent.name + ' (Loop Agent)'
73 elif isinstance(tool_or_agent, ParallelAgent):
74 return tool_or_agent.name + ' (Parallel Agent)'
75 else:
76 return tool_or_agent.name
77 elif isinstance(tool_or_agent, BaseTool):
78 return tool_or_agent.name
79 elif hasattr(tool_or_agent, 'name'):
80 return tool_or_agent.name
81 else:
82 raise ValueError(f'Unsupported tool type: {tool_or_agent}')
83
84 def get_node_caption(tool_or_agent: Union[BaseAgent, BaseTool]):
85

Callers 2

draw_nodeFunction · 0.85
build_graphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected