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

Function _remap_node_path

src/google/adk/cli/agent_test_runner.py:332–346  ·  view source on GitHub ↗

Rewrite `` @ `` segments in a node path using ``id_map``. Path segments encode `` @ ``; when the run_id was an LLM-generated FC id, it gets canonicalized to ``fc-N`` via ``id_map``. Segments without ``@`` and ids not in ``id_map`` pass through unchanged.

(path: str, id_map: dict[str, str])

Source from the content-addressed store, hash-verified

330
331
332def _remap_node_path(path: str, id_map: dict[str, str]) -> str:
333 """Rewrite ``<name>@<id>`` segments in a node path using ``id_map``.
334
335 Path segments encode ``<node_name>@<run_id>``; when the run_id was an
336 LLM-generated FC id, it gets canonicalized to ``fc-N`` via ``id_map``.
337 Segments without ``@`` and ids not in ``id_map`` pass through unchanged.
338 """
339 segments = []
340 for seg in path.split("/"):
341 if "@" in seg:
342 name, rid = seg.split("@", 1)
343 if rid in id_map:
344 seg = f"{name}@{id_map[rid]}"
345 segments.append(seg)
346 return "/".join(segments)
347
348
349def _normalize_ids(events: list[AdkEvent]) -> list[AdkEvent]:

Callers 1

_normalize_idsFunction · 0.85

Calls 3

splitMethod · 0.80
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected