MCPcopy Create free account
hub / github.com/google/adk-python / _resolve_under_dir

Function _resolve_under_dir

src/google/adk/cli/fast_api.py:198–204  ·  view source on GitHub ↗
(root_dir: Path, rel_path: str)

Source from the content-addressed store, hash-verified

196 return file_path
197
198 def _resolve_under_dir(root_dir: Path, rel_path: str) -> Path:
199 file_path = root_dir / rel_path
200 resolved_root_dir = root_dir.resolve()
201 resolved_file_path = file_path.resolve()
202 if not resolved_file_path.is_relative_to(resolved_root_dir):
203 raise ValueError(f"Path escapes root_dir: {rel_path!r}")
204 return file_path
205
206 def _get_tmp_agent_root(app_root: Path, app_name: str) -> Path:
207 tmp_agent_root = app_root / "tmp" / app_name

Callers 4

builder_buildMethod · 0.85
get_agent_builderMethod · 0.85
builder_buildFunction · 0.85
get_agent_builderFunction · 0.85

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected