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

Function get_node_caption

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

Source from the content-addressed store, hash-verified

82 raise ValueError(f'Unsupported tool type: {tool_or_agent}')
83
84 def get_node_caption(tool_or_agent: Union[BaseAgent, BaseTool]):
85
86 if isinstance(tool_or_agent, BaseAgent):
87 return '🤖 ' + tool_or_agent.name
88 elif retrieval_tool_module_loaded and isinstance(
89 tool_or_agent, BaseRetrievalTool
90 ):
91 return '🔎 ' + tool_or_agent.name
92 elif isinstance(tool_or_agent, FunctionTool):
93 return '🔧 ' + tool_or_agent.name
94 elif isinstance(tool_or_agent, AgentTool):
95 return '🤖 ' + tool_or_agent.name
96 elif isinstance(tool_or_agent, BaseTool):
97 return '🔧 ' + tool_or_agent.name
98 elif hasattr(tool_or_agent, 'name'):
99 return tool_or_agent.name
100 else:
101 logger.warning(
102 'Unsupported tool, type: %s, obj: %s',
103 type(tool_or_agent),
104 tool_or_agent,
105 )
106 return f'❓ Unsupported tool type: {type(tool_or_agent)}'
107
108 def get_node_shape(tool_or_agent: Union[BaseAgent, BaseTool]):
109 if isinstance(tool_or_agent, BaseAgent):

Callers 1

draw_nodeFunction · 0.85

Calls 1

typeFunction · 0.85

Tested by

no test coverage detected