项目文件夹

文件
wehub-resource-sync ec2b666284
Continuous Integration / Pre-commit Linter (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.10) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.11) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.12) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.12) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.12) (push) Has been cancelled
Copybara PR Handler / close-imported-pr (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.14) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:25:13 +08:00

1.5 KiB

Agent

The Agent (represented by BaseAgent in code) is a public interface in ADK that serves as a blueprint defining identity, instructions, and tools for an agentic entity. It inherits from BaseNode and can be part of a larger workflow or act as a standalone agent.

Key Characteristics

  • Name: Unique identifier within the agent tree. Must be a valid Python identifier and cannot be "user".
  • Description: Capability description used by the model for delegation.
  • Sub-agents: Support for hierarchical agent structures.
  • Callbacks: Supports before_agent_callback and after_agent_callback for intercepting lifecycle events.

Entrance Methods

Important

Since agents now extend BaseNode, the original run_async entrance method is considered deprecated. Developers should rely on the new run method from BaseNode to execute agents as workflow nodes.

run (Preferred Entrance)

The method inherited from BaseNode to execute the agent.

run_async (Deprecated)

Legacy entry method to run an agent via text-based conversation.

Arguments:

  • parent_context: InvocationContext, the invocation context of the parent agent.

Yields:

  • Event: The events generated by the agent.

run_live

Entry method to run an agent via video/audio-based conversation.

Arguments:

  • parent_context: InvocationContext, the invocation context of the parent agent.

Yields:

  • Event: The events generated by the agent.

from_config

Class method to create an agent from a configuration object.