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

Function _ensure_agent_engine_dependency

src/google/adk/cli/cli_deploy.py:40–64  ·  view source on GitHub ↗

Ensures staged requirements include Agent Platform dependencies.

(requirements_txt_path: str)

Source from the content-addressed store, hash-verified

38
39
40def _ensure_agent_engine_dependency(requirements_txt_path: str) -> None:
41 """Ensures staged requirements include Agent Platform dependencies."""
42 if not os.path.exists(requirements_txt_path):
43 raise FileNotFoundError(
44 f'requirements.txt not found at: {requirements_txt_path}'
45 )
46
47 requirements = ''
48 with open(requirements_txt_path, 'r', encoding='utf-8') as f:
49 requirements = f.read()
50
51 for line in requirements.splitlines():
52 stripped = line.strip()
53 if (
54 stripped
55 and not stripped.startswith('#')
56 and stripped.startswith('google-cloud-aiplatform')
57 ):
58 return
59
60 with open(requirements_txt_path, 'a', encoding='utf-8') as f:
61 if requirements and not requirements.endswith('\n'):
62 f.write('\n')
63 f.write('google-cloud-aiplatform[agent_engines]\n')
64 f.write(f'google-adk[a2a]=={__version__}\n')
65
66
67_DOCKERFILE_TEMPLATE: Final[str] = """

Callers 1

to_agent_engineFunction · 0.85

Calls 5

openFunction · 0.85
stripMethod · 0.80
existsMethod · 0.45
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected