Skip to content

Commit 9cf7ab1

Browse files
GWealecopybara-github
authored andcommitted
docs: Update agent builder instructions for clarity and best practices for ADK specific requirements
PiperOrigin-RevId: 822862453
1 parent 055e86a commit 9cf7ab1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

contributing/samples/adk_agent_builder_assistant/instruction_embedded.template

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,13 @@ def log_tool_result(tool: BaseTool, tool_args: Dict[str, Any], tool_context: Too
393393
**File Naming & Structure:**
394394
- Main configuration MUST be `root_agent.yaml` (not `agent.yaml`)
395395
- Agent directories need `__init__.py` with `from . import agent`
396-
- **Tools directory MUST have `__init__.py`** - The `tools/` folder requires an empty `__init__.py` file to be a valid Python package (required for imports)
396+
- Place each tool in the `tools/` package using one module per tool (for example, `tools/dice_tool.py`).
397+
Add an empty `tools/__init__.py` so imports such as `project_name.tools.dice_tool.roll_dice` work.
397398
- Python files in agent directory, YAML at root level
398399

399400
**Tool Configuration:**
400-
- Function tools: `project_name.tools.module.function_name` format (all dots, must start with project folder name)
401+
- Function tools: Use dotted import paths that start with the project folder name
402+
(e.g., `project_name.tools.dice_tool.roll_dice`)
401403
- No `.py` extension in tool paths
402404
- No function declarations needed in YAML
403405
- **Critical**: Tool paths must include the project folder name as the first component (final component of project folder path only)
@@ -407,7 +409,7 @@ def log_tool_result(tool: BaseTool, tool_args: Dict[str, Any], tool_context: Too
407409
- **SequentialAgent**: NO `model` field - workflow agent that orchestrates other agents in sequence
408410
- **ParallelAgent**: NO `model` field - workflow agent that runs multiple agents in parallel
409411
- **LoopAgent**: NO `model` field - workflow agent that executes agents in a loop
410-
- **CRITICAL**: Only LlmAgent accepts a model field. Workflow agents (Sequential/Parallel/Loop) do NOT have model fields
412+
- **CRITICAL**: Only LlmAgent accepts a model field. Workflow agents (Sequential/Parallel/Loop) do NOT have model fields or tool lists; they orchestrate `sub_agents` that provide tooling.
411413

412414
**ADK AgentConfig Schema Compliance:**
413415
- Always reference the embedded ADK AgentConfig schema to verify field requirements
@@ -447,6 +449,7 @@ def log_tool_result(tool: BaseTool, tool_args: Dict[str, Any], tool_context: Too
447449
2. No redundant suggest_file_path calls for pre-approved paths
448450
3. Generated configurations pass schema validation (automatically checked)
449451
4. Follow ADK naming and organizational conventions
452+
5. Every agent configuration explicitly sets `agent_class` and the value matches the agent role; custom classes use a fully qualified dotted path
450453
6. Include clear, actionable instructions for each agent
451454
7. Use appropriate tools for intended functionality
452455

0 commit comments

Comments
 (0)