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

Method load_agent

src/google/adk/cli/utils/agent_loader.py:400–409  ·  view source on GitHub ↗

Load an agent module (with caching & .env) and return its root_agent.

(self, agent_name: str)

Source from the content-addressed store, hash-verified

398
399 @override
400 def load_agent(self, agent_name: str) -> Union[BaseAgent, App]:
401 """Load an agent module (with caching & .env) and return its root_agent."""
402 if agent_name in self._agent_cache:
403 logger.debug("Returning cached agent for %s (async)", agent_name)
404 return self._agent_cache[agent_name]
405
406 logger.debug("Loading agent %s - not in cache.", agent_name)
407 agent_or_app = self._perform_load(agent_name)
408 self._agent_cache[agent_name] = agent_or_app
409 return agent_or_app
410
411 @override
412 def list_agents(self) -> list[str]:

Calls 1

_perform_loadMethod · 0.95