.agents/skills/adk-style/references/imports.md
src/): Use relative imports.
from ..agents.llm_agent import LlmAgenttests/): Use absolute imports.
from google.adk.agents.llm_agent import LlmAgent__init__.py.
from ..agents.llm_agent import LlmAgent (not from ..agents import LlmAgent)cli/):
cli/ package.cli/ package.cli/ can import from the rest of the codebase. The other codebase must STRICTLY NOT import from cli/.Use TYPE_CHECKING for imports needed only by type hints to avoid circular imports at runtime:
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..agents.invocation_context import InvocationContext
This works because from __future__ import annotations makes all annotations strings (deferred evaluation), so the import is never needed at runtime.