Skip to content

Commit 824c6c4

Browse files
committed
Merge branch 'refs/heads/main' into feat/function-tools-enum-support
2 parents 598fee6 + 9ab17f2 commit 824c6c4

280 files changed

Lines changed: 24684 additions & 8350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**
2+
3+
### Link to Issue or Description of Change
4+
5+
**1. Link to an existing issue (if applicable):**
6+
7+
- Closes: #_issue_number_
8+
- Related: #_issue_number_
9+
10+
**2. Or, if no issue exists, describe the change:**
11+
12+
_If applicable, please follow the issue templates to provide as much detail as
13+
possible._
14+
15+
**Problem:**
16+
_A clear and concise description of what the problem is._
17+
18+
**Solution:**
19+
_A clear and concise description of what you want to happen and why you choose
20+
this solution._
21+
22+
### Testing Plan
23+
24+
_Please describe the tests that you ran to verify your changes. This is required
25+
for all PRs that are not small documentation or typo fixes._
26+
27+
**Unit Tests:**
28+
29+
- [ ] I have added or updated unit tests for my change.
30+
- [ ] All unit tests pass locally.
31+
32+
_Please include a summary of passed `pytest` results._
33+
34+
**Manual End-to-End (E2E) Tests:**
35+
36+
_Please provide instructions on how to manually test your changes, including any
37+
necessary setup or configuration. Please provide logs or screenshots to help
38+
reviewers better understand the fix._
39+
40+
### Checklist
41+
42+
- [ ] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
43+
- [ ] I have performed a self-review of my own code.
44+
- [ ] I have commented my code, particularly in hard-to-understand areas.
45+
- [ ] I have added tests that prove my fix is effective or that my feature works.
46+
- [ ] New and existing unit tests pass locally with my changes.
47+
- [ ] I have manually tested my changes end-to-end.
48+
- [ ] Any dependent changes have been merged and published in downstream modules.
49+
50+
### Additional context
51+
52+
_Add any other context or screenshots about the feature request here._

.github/workflows/pr-triage.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: ADK Pull Request Triaging Agent
33
on:
44
pull_request_target:
55
types: [opened, reopened, edited]
6+
workflow_dispatch:
7+
inputs:
8+
pr_number:
9+
description: 'The Pull Request number to triage'
10+
required: true
11+
type: 'string'
612

713
jobs:
814
agent-triage-pull-request:
9-
if: "!contains(github.event.pull_request.labels.*.name, 'bot triaged') && !contains(github.event.pull_request.labels.*.name, 'google-contributor')"
15+
if: github.event_name == 'workflow_dispatch' || !contains(github.event.pull_request.labels.*.name, 'google-contributor')
1016
runs-on: ubuntu-latest
1117
permissions:
1218
pull-requests: write
@@ -33,7 +39,7 @@ jobs:
3339
GOOGLE_GENAI_USE_VERTEXAI: 0
3440
OWNER: 'google'
3541
REPO: 'adk-python'
36-
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
42+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
3743
INTERACTIVE: ${{ vars.PR_TRIAGE_INTERACTIVE }}
3844
PYTHONPATH: contributing/samples
3945
run: python -m adk_pr_triaging_agent.main

.github/workflows/triage.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: ADK Issue Triaging Agent
33
on:
44
issues:
55
types: [opened, reopened]
6-
schedule:
7-
- cron: '0 */6 * * *' # every 6h
86

97
jobs:
108
agent-triage-issues:

CHANGELOG.md

Lines changed: 158 additions & 11 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ information on using pull requests.
5757
### Requirement for PRs
5858

5959
- All PRs, other than small documentation or typo fixes, should have a Issue
60-
associated. If not, please create one.
60+
associated. If a relevant issue doesn't exist, please create one first or
61+
you may instead describe the bug or feature directly within the PR
62+
description, following the structure of our issue templates.
6163
- Small, focused PRs. Keep changes minimal—one concern per PR.
6264
- For bug fixes or features, please provide logs or screenshot after the fix
6365
is applied to help reviewers better understand the fix.

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
Agent Development Kit (ADK) is a flexible and modular framework for developing and deploying AI agents. While optimized for Gemini and the Google ecosystem, ADK is model-agnostic, deployment-agnostic, and is built for compatibility with other frameworks. ADK was designed to make agent development feel more like software development, to make it easier for developers to create, deploy, and orchestrate agentic architectures that range from simple tasks to complex workflows.
2626

27-
2827
---
2928

3029
## 🔥 What's new
3130

32-
- **Agent Config**: Build agents without code. Check out the
33-
[Agent Config](https://google.github.io/adk-docs/agents/config/) feature.
31+
- **Custom Service Registration**: Add a service registry to provide a generic way to register custom service implementations to be used in FastAPI server. See short instruction [here](https://github.com/google/adk-python/discussions/3175#discussioncomment-14745120). ([391628f](https://github.com/google/adk-python/commit/391628fcdc7b950c6835f64ae3ccab197163c990))
3432

35-
- **Tool Confirmation**: A [tool confirmation flow(HITL)](https://google.github.io/adk-docs/tools/confirmation/) that can guard tool execution with explicit confirmation and custom input
33+
- **Rewind**: Add the ability to rewind a session to before a previous invocation ([9dce06f](https://github.com/google/adk-python/commit/9dce06f9b00259ec42241df4f6638955e783a9d1)).
34+
35+
- **New CodeExecutor**: Introduces a new AgentEngineSandboxCodeExecutor class that supports executing agent-generated code using the Vertex AI Code Execution Sandbox API ([ee39a89](https://github.com/google/adk-python/commit/ee39a891106316b790621795b5cc529e89815a98))
3636

3737
## ✨ Key Features
3838

@@ -43,6 +43,11 @@ Agent Development Kit (ADK) is a flexible and modular framework for developing a
4343
- **Code-First Development**: Define agent logic, tools, and orchestration
4444
directly in Python for ultimate flexibility, testability, and versioning.
4545

46+
- **Agent Config**: Build agents without code. Check out the
47+
[Agent Config](https://google.github.io/adk-docs/agents/config/) feature.
48+
49+
- **Tool Confirmation**: A [tool confirmation flow(HITL)](https://google.github.io/adk-docs/tools/confirmation/) that can guard tool execution with explicit confirmation and custom input.
50+
4651
- **Modular Multi-Agent Systems**: Design scalable applications by composing
4752
multiple specialized agents into flexible hierarchies.
4853

@@ -150,6 +155,10 @@ We welcome contributions from the community! Whether it's bug reports, feature r
150155

151156
If you are to develop agent via vibe coding the [llms.txt](./llms.txt) and the [llms-full.txt](./llms-full.txt) can be used as context to LLM. While the former one is a summarized one and the later one has the full information in case your LLM has big enough context window.
152157

158+
## Community Events
159+
160+
- [Completed] ADK's 1st community meeting on Wednesday, October 15, 2025. Remember to [join our group](https://groups.google.com/g/adk-community) to get access to the [recording](https://drive.google.com/file/d/1rpXDq5NSH8-MyMeYI6_5pZ3Lhn0X9BQf/view), and [deck](https://docs.google.com/presentation/d/1_b8LG4xaiadbUUDzyNiapSFyxanc9ZgFdw7JQ6zmZ9Q/edit?slide=id.g384e60cdaca_0_658&resourcekey=0-tjFFv0VBQhpXBPCkZr0NOg#slide=id.g384e60cdaca_0_658).
161+
153162
## 📄 License
154163

155164
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.

contributing/samples/adk_agent_builder_assistant/agent_builder_assistant.py

Lines changed: 39 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
from google.adk.tools import FunctionTool
2727
from google.genai import types
2828

29+
from .sub_agents.adk_knowledge_agent import create_adk_knowledge_agent
2930
from .sub_agents.google_search_agent import create_google_search_agent
3031
from .sub_agents.url_context_agent import create_url_context_agent
3132
from .tools.cleanup_unused_files import cleanup_unused_files
3233
from .tools.delete_files import delete_files
3334
from .tools.explore_project import explore_project
3435
from .tools.read_config_files import read_config_files
3536
from .tools.read_files import read_files
36-
from .tools.resolve_root_directory import resolve_root_directory
3737
from .tools.search_adk_source import search_adk_source
3838
from .tools.write_config_files import write_config_files
3939
from .tools.write_files import write_files
@@ -59,9 +59,7 @@ def create_agent(
5959
Configured LlmAgent with embedded ADK AgentConfig schema
6060
"""
6161
# Load full ADK AgentConfig schema directly into instruction context
62-
instruction = AgentBuilderAssistant._load_instruction_with_schema(
63-
model, working_directory
64-
)
62+
instruction = AgentBuilderAssistant._load_instruction_with_schema(model)
6563

6664
# TOOL ARCHITECTURE: Hybrid approach using both AgentTools and FunctionTools
6765
#
@@ -71,9 +69,14 @@ def create_agent(
7169
# - Maintains compatibility with existing ADK tool ecosystem
7270

7371
# Built-in ADK tools wrapped as sub-agents
72+
adk_knowledge_agent = create_adk_knowledge_agent()
7473
google_search_agent = create_google_search_agent()
7574
url_context_agent = create_url_context_agent()
76-
agent_tools = [AgentTool(google_search_agent), AgentTool(url_context_agent)]
75+
agent_tools = [
76+
AgentTool(adk_knowledge_agent),
77+
AgentTool(google_search_agent),
78+
AgentTool(url_context_agent),
79+
]
7780

7881
# CUSTOM FUNCTION TOOLS: Agent Builder specific capabilities
7982
#
@@ -89,8 +92,6 @@ def create_agent(
8992
write_config_files
9093
), # Write/validate multiple YAML configs
9194
FunctionTool(explore_project), # Analyze project structure
92-
# Working directory context tools
93-
FunctionTool(resolve_root_directory),
9495
# File management tools (multi-file support)
9596
FunctionTool(read_files), # Read multiple files
9697
FunctionTool(write_files), # Write multiple files
@@ -129,7 +130,6 @@ def _load_schema() -> str:
129130
# ADK AgentConfig schema loading with caching and error handling.
130131
schema_content = load_agent_config_schema(
131132
raw_format=True, # Get as JSON string
132-
escape_braces=True, # Escape braces for template embedding
133133
)
134134

135135
# Format as indented code block for instruction embedding
@@ -151,7 +151,6 @@ def _load_schema() -> str:
151151
@staticmethod
152152
def _load_instruction_with_schema(
153153
model: Union[str, BaseLlm],
154-
working_directory: Optional[str] = None,
155154
) -> Callable[[ReadonlyContext], str]:
156155
"""Load instruction template and embed ADK AgentConfig schema content."""
157156
instruction_template = (
@@ -166,19 +165,43 @@ def _load_instruction_with_schema(
166165
else getattr(model, "model_name", str(model))
167166
)
168167

169-
# Fill the instruction template with ADK AgentConfig schema content and default model
170-
instruction_text = instruction_template.format(
171-
schema_content=schema_content, default_model=model_str
172-
)
173-
174168
# Return a function that accepts ReadonlyContext and returns the instruction
175169
def instruction_provider(context: ReadonlyContext) -> str:
176-
return AgentBuilderAssistant._compile_instruction_with_context(
177-
instruction_text, context, working_directory
170+
# Extract project folder name from session state
171+
project_folder_name = AgentBuilderAssistant._extract_project_folder_name(
172+
context
178173
)
179174

175+
# Fill the instruction template with all variables
176+
instruction_text = instruction_template.format(
177+
schema_content=schema_content,
178+
default_model=model_str,
179+
project_folder_name=project_folder_name,
180+
)
181+
return instruction_text
182+
180183
return instruction_provider
181184

185+
@staticmethod
186+
def _extract_project_folder_name(context: ReadonlyContext) -> str:
187+
"""Extract project folder name from session state using resolve_file_path."""
188+
from .utils.resolve_root_directory import resolve_file_path
189+
190+
session_state = context._invocation_context.session.state
191+
192+
# Use resolve_file_path to get the full resolved path for "."
193+
# This handles all the root_directory resolution logic consistently
194+
resolved_path = resolve_file_path(".", session_state)
195+
196+
# Extract the project folder name from the resolved path
197+
project_folder_name = resolved_path.name
198+
199+
# Fallback to "project" if we somehow get an empty name
200+
if not project_folder_name:
201+
project_folder_name = "project"
202+
203+
return project_folder_name
204+
182205
@staticmethod
183206
def _load_embedded_schema_instruction_template() -> str:
184207
"""Load instruction template for embedded ADK AgentConfig schema mode."""
@@ -191,70 +214,3 @@ def _load_embedded_schema_instruction_template() -> str:
191214

192215
with open(template_path, "r", encoding="utf-8") as f:
193216
return f.read()
194-
195-
@staticmethod
196-
def _compile_instruction_with_context(
197-
instruction_text: str,
198-
context: ReadonlyContext,
199-
working_directory: Optional[str] = None,
200-
) -> str:
201-
"""Compile instruction with session context and working directory information.
202-
203-
This method enhances instructions with:
204-
1. Working directory information for path resolution
205-
2. Session-based root directory binding if available
206-
207-
Args:
208-
instruction_text: Base instruction text
209-
context: ReadonlyContext from the agent session
210-
working_directory: Optional working directory for path resolution
211-
212-
Returns:
213-
Enhanced instruction text with context information
214-
"""
215-
import os
216-
217-
# Get working directory (use provided or current working directory)
218-
actual_working_dir = working_directory or os.getcwd()
219-
220-
# Check for existing root directory in session state
221-
session_root_directory = context._invocation_context.session.state.get(
222-
"root_directory"
223-
)
224-
225-
# Compile additional context information
226-
context_info = f"""
227-
228-
## SESSION CONTEXT
229-
230-
**Working Directory**: `{actual_working_dir}`
231-
- Use this as the base directory for path resolution when calling resolve_root_directory
232-
- Pass this as the working_directory parameter to resolve_root_directory tool
233-
234-
"""
235-
236-
if session_root_directory:
237-
context_info += f"""**Established Root Directory**: `{session_root_directory}`
238-
- This session is bound to root directory: {session_root_directory}
239-
- DO NOT ask the user for root directory - use this established path
240-
- All agent building should happen within this root directory
241-
- If user wants to work in a different directory, ask them to start a new chat session
242-
243-
"""
244-
else:
245-
context_info += f"""**Root Directory**: Not yet established
246-
- You MUST ask the user for their desired root directory first
247-
- Use resolve_root_directory tool to validate the path
248-
- Once confirmed, this session will be bound to that root directory
249-
250-
"""
251-
252-
context_info += """**Session Binding Rules**:
253-
- Each chat session is bound to ONE root directory
254-
- Once established, work only within that root directory
255-
- To switch directories, user must start a new chat session
256-
- Always verify paths using resolve_root_directory tool before creating files
257-
258-
"""
259-
260-
return instruction_text + context_info

0 commit comments

Comments
 (0)