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

Function _get_app_root

src/google/adk/cli/fast_api.py:118–126  ·  view source on GitHub ↗
(app_name: str)

Source from the content-addressed store, hash-verified

116 agents_base_path = (Path.cwd() / agents_dir).resolve()
117
118 def _get_app_root(app_name: str) -> Path:
119 if app_name in ("", ".", ".."):
120 raise ValueError(f"Invalid app name: {app_name!r}")
121 if Path(app_name).name != app_name or "\\" in app_name:
122 raise ValueError(f"Invalid app name: {app_name!r}")
123 app_root = (agents_base_path / app_name).resolve()
124 if not app_root.is_relative_to(agents_base_path):
125 raise ValueError(f"Invalid app name: {app_name!r}")
126 return app_root
127
128 def _normalize_relative_path(path: str) -> str:
129 return path.replace("\\", "/").lstrip("/")

Callers 8

cleanup_tmpMethod · 0.85
ensure_tmp_existsMethod · 0.85
builder_buildMethod · 0.85
get_agent_builderMethod · 0.85
cleanup_tmpFunction · 0.85
ensure_tmp_existsFunction · 0.85
builder_buildFunction · 0.85
get_agent_builderFunction · 0.85

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected