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

Function ensure_tmp_exists

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

Source from the content-addressed store, hash-verified

263 return True
264
265 def ensure_tmp_exists(app_name: str) -> bool:
266 try:
267 app_root = _get_app_root(app_name)
268 except ValueError as exc:
269 logger.exception("Error in ensure_tmp_exists: %s", exc)
270 return False
271
272 if not app_root.is_dir():
273 return False
274
275 try:
276 tmp_agent_root = _get_tmp_agent_root(app_root, app_name)
277 except ValueError as exc:
278 logger.exception("Error in ensure_tmp_exists: %s", exc)
279 return False
280
281 if tmp_agent_root.exists():
282 return True
283
284 try:
285 tmp_agent_root.mkdir(parents=True, exist_ok=True)
286 copy_dir_contents(app_root, tmp_agent_root)
287 except OSError as exc:
288 logger.exception("Error in ensure_tmp_exists: %s", exc)
289 return False
290
291 return True
292
293 @app.post("/builder/save", response_model_exclude_none=True)
294 async def builder_build(

Callers 2

get_agent_builderMethod · 0.85
get_agent_builderFunction · 0.85

Calls 4

_get_app_rootFunction · 0.85
_get_tmp_agent_rootFunction · 0.85
copy_dir_contentsFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected