Skip to content

Commit e7b8e5e

Browse files
authored
Merge branch 'main' into fix/transcript_finish
2 parents d9aee2a + 63b69fb commit e7b8e5e

File tree

96 files changed

+2699
-557
lines changed

Some content is hidden

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

96 files changed

+2699
-557
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Steps to reproduce the behavior:
1919
1. Install '...'
2020
2. Run '....'
2121
3. Open '....'
22-
4. Provie error or stacktrace
22+
4. Provide error or stacktrace
2323

2424
**Expected behavior**
2525
A clear and concise description of what you expected to happen.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
* Fix issue with MCP tools throwing an error ([1a4261a](https://github.com/google/adk-python/commit/1a4261ad4b66cdeb39d39110a086bd6112b17516))
8080
* Remove redundant `format` field from LiteLLM content objects ([489c39d](https://github.com/google/adk-python/commit/489c39db01465e38ecbc2c7f32781c349b8cddc9))
8181
* Update the contribution analysis tool to use original write mode ([54db3d4](https://github.com/google/adk-python/commit/54db3d4434e0706b83a589fa2499d11d439a6e4e))
82+
* Fix agent evaluations detailed output rows wrapping issue([4284c61](https://github.com/google/adk-python/commit/4284c619010b8246c1ecaa011f14b6cc9de512dd))
83+
* Update dependency version constraints to be based on PyPI versions([0b1784e](https://github.com/google/adk-python/commit/0b1784e0e493a0e2df1edfe37e5ed5f4247e7d9d))
8284

8385
### Improvements
8486

@@ -97,6 +99,7 @@
9799
* Add sample agent for VertexAiCodeExecutor ([edfe553](https://github.com/google/adk-python/commit/edfe5539421d196ca4da14d3a37fac7b598f8c8d))
98100
* Adds a new sample agent that demonstrates how to integrate PostgreSQL databases using the Model Context Protocol (MCP) ([45a2168](https://github.com/google/adk-python/commit/45a2168e0e6773e595ecfb825d7e4ab0a38c3a38))
99101
* Add example for using ADK with Fast MCP sampling ([d3796f9](https://github.com/google/adk-python/commit/d3796f9b33251d28d05e6701f11e80f02a2a49e1))
102+
* Refactor gepa sample code and clean-up user demo colab([63353b2](https://github.com/google/adk-python/commit/63353b2b74e23e97385892415c5a3f2a59c3504f))
100103

101104
## [1.17.0](https://github.com/google/adk-python/compare/v1.16.0...v1.17.0) (2025-10-22)
102105

contributing/samples/adk_agent_builder_assistant/agent_builder_assistant.py

Lines changed: 169 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"""Agent factory for creating Agent Builder Assistant with embedded schema."""
1616

1717
from pathlib import Path
18+
import textwrap
19+
from typing import Any
1820
from typing import Callable
1921
from typing import Optional
2022
from typing import Union
@@ -128,25 +130,175 @@ def _load_schema() -> str:
128130
# CENTRALIZED ADK AGENTCONFIG SCHEMA LOADING: Use common utility function
129131
# This avoids duplication across multiple files and provides consistent
130132
# ADK AgentConfig schema loading with caching and error handling.
131-
schema_content = load_agent_config_schema(
132-
raw_format=True, # Get as JSON string
133+
schema_dict = load_agent_config_schema()
134+
return AgentBuilderAssistant._build_schema_reference(schema_dict)
135+
136+
@staticmethod
137+
def _build_schema_reference(schema: dict[str, Any]) -> str:
138+
"""Create compact AgentConfig reference text for prompt embedding."""
139+
140+
defs: dict[str, Any] = schema.get("$defs", {})
141+
top_level_fields: dict[str, Any] = schema.get("properties", {})
142+
wrapper = textwrap.TextWrapper(width=78)
143+
lines: list[str] = []
144+
145+
def add(text: str = "", indent: int = 0) -> None:
146+
"""Append wrapped text with indentation."""
147+
if not text:
148+
lines.append("")
149+
return
150+
indent_str = " " * indent
151+
wrapper.initial_indent = indent_str
152+
wrapper.subsequent_indent = indent_str
153+
lines.extend(wrapper.fill(text).split("\n"))
154+
155+
add("ADK AgentConfig quick reference")
156+
add("--------------------------------")
157+
158+
add()
159+
add("LlmAgent (agent_class: LlmAgent)")
160+
add(
161+
"Required fields: name, instruction. ADK best practice is to always set"
162+
" model explicitly.",
163+
indent=2,
164+
)
165+
add("Optional fields:", indent=2)
166+
add("agent_class: defaults to LlmAgent; keep for clarity.", indent=4)
167+
add("description: short summary string.", indent=4)
168+
add("sub_agents: list of AgentRef entries (see below).", indent=4)
169+
add(
170+
"before_agent_callbacks / after_agent_callbacks: list of CodeConfig "
171+
"entries that run before or after the agent loop.",
172+
indent=4,
173+
)
174+
add("model: string model id (required in practice).", indent=4)
175+
add(
176+
"disallow_transfer_to_parent / disallow_transfer_to_peers: booleans to "
177+
"restrict automatic transfer.",
178+
indent=4,
179+
)
180+
add(
181+
"input_schema / output_schema: JSON schema objects to validate inputs "
182+
"and outputs.",
183+
indent=4,
184+
)
185+
add("output_key: name to store agent output in session context.", indent=4)
186+
add(
187+
"include_contents: bool; include tool/LLM contents in response.",
188+
indent=4,
189+
)
190+
add("tools: list of ToolConfig entries (see below).", indent=4)
191+
add(
192+
"before_model_callbacks / after_model_callbacks: list of CodeConfig "
193+
"entries around LLM calls.",
194+
indent=4,
195+
)
196+
add(
197+
"before_tool_callbacks / after_tool_callbacks: list of CodeConfig "
198+
"entries around tool calls.",
199+
indent=4,
200+
)
201+
add(
202+
"generate_content_config: passes directly to google.genai "
203+
"GenerateContentConfig (supporting temperature, topP, topK, "
204+
"maxOutputTokens, safetySettings, responseSchema, routingConfig,"
205+
" etc.).",
206+
indent=4,
133207
)
134208

135-
# Format as indented code block for instruction embedding
136-
#
137-
# Why indentation is needed:
138-
# - The ADK AgentConfig schema gets embedded into instruction templates using .format()
139-
# - Proper indentation maintains readability in the final instruction
140-
# - Code block markers (```) help LLMs recognize this as structured data
141-
#
142-
# Example final instruction format:
143-
# "Here is the ADK AgentConfig schema:
144-
# ```json
145-
# {"type": "object", "properties": {...}}
146-
# ```"
147-
lines = schema_content.split("\n")
148-
indented_lines = [" " + line for line in lines] # 2-space indent
149-
return "```json\n" + "\n".join(indented_lines) + "\n ```"
209+
add()
210+
add("Workflow agents (LoopAgent, ParallelAgent, SequentialAgent)")
211+
add(
212+
"Share BaseAgent fields: agent_class, name, description, sub_agents, "
213+
"before/after_agent_callbacks. Never declare model, instruction, or "
214+
"tools on workflow orchestrators.",
215+
indent=2,
216+
)
217+
add(
218+
"LoopAgent adds max_iterations (int) controlling iteration cap.",
219+
indent=2,
220+
)
221+
222+
add()
223+
add("AgentRef")
224+
add(
225+
"Used inside sub_agents lists. Provide either config_path (string path "
226+
"to another YAML file) or code (dotted Python reference) to locate the "
227+
"sub-agent definition.",
228+
indent=2,
229+
)
230+
231+
add()
232+
add("ToolConfig")
233+
add(
234+
"Items inside tools arrays. Required field name (string). For built-in "
235+
"tools use the exported short name, for custom tools use the dotted "
236+
"module path.",
237+
indent=2,
238+
)
239+
add(
240+
"args: optional object of additional keyword arguments. Use simple "
241+
"key-value pairs (ToolArgsConfig) or structured ArgumentConfig entries "
242+
"when a list is required by callbacks.",
243+
indent=2,
244+
)
245+
246+
add()
247+
add("ArgumentConfig")
248+
add(
249+
"Represents a single argument. value is required and may be any JSON "
250+
"type. name is optional (null allowed). Often used in callback args.",
251+
indent=2,
252+
)
253+
254+
add()
255+
add("CodeConfig")
256+
add(
257+
"References Python code for callbacks or dynamic tool creation."
258+
" Requires name (dotted path). args is an optional list of"
259+
" ArgumentConfig items executed when invoking the function.",
260+
indent=2,
261+
)
262+
263+
add()
264+
add("GenerateContentConfig highlights")
265+
add(
266+
"Controls LLM generation behavior. Common fields: maxOutputTokens, "
267+
"temperature, topP, topK, candidateCount, responseMimeType, "
268+
"responseSchema/responseJsonSchema, automaticFunctionCalling, "
269+
"safetySettings, routingConfig; see Vertex AI GenAI docs for full "
270+
"semantics.",
271+
indent=2,
272+
)
273+
274+
add()
275+
add(
276+
"All other schema definitions in AgentConfig.json remain available but "
277+
"are rarely needed for typical agent setups. Refer to the source file "
278+
"for exhaustive field descriptions when implementing advanced configs.",
279+
)
280+
281+
if top_level_fields:
282+
add()
283+
add("Top-level AgentConfig fields (from schema)")
284+
for field_name in sorted(top_level_fields):
285+
description = top_level_fields[field_name].get("description", "")
286+
if description:
287+
add(f"{field_name}: {description}", indent=2)
288+
else:
289+
add(field_name, indent=2)
290+
291+
if defs:
292+
add()
293+
add("Additional schema definitions")
294+
for def_name in sorted(defs):
295+
description = defs[def_name].get("description", "")
296+
if description:
297+
add(f"{def_name}: {description}", indent=2)
298+
else:
299+
add(def_name, indent=2)
300+
301+
return "```text\n" + "\n".join(lines) + "\n```"
150302

151303
@staticmethod
152304
def _load_instruction_with_schema(

contributing/samples/adk_agent_builder_assistant/tools/search_adk_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def search_adk_source(
4646
max_results: Maximum number of results to return (default: 20)
4747
context_lines: Number of context lines to include around matches (default:
4848
3)
49-
case_sensitive: Whether search should be case sensitive (default: False)
49+
case_sensitive: Whether search should be case-sensitive (default: False)
5050
5151
Returns:
5252
Dict containing search results:

contributing/samples/adk_agent_builder_assistant/tools/write_config_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def write_config_files(
6666
6767
Args:
6868
configs: Dict mapping file_path to config_content (YAML as string)
69-
backup_existing: Whether to create timest amped backup of existing files
69+
backup_existing: Whether to create timestamped backup of existing files
7070
before overwriting (default: False, User should decide)
7171
create_directories: Whether to create parent directories if they don't exist
7272
(default: True)

contributing/samples/adk_answering_agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
6262
3. **Decide whether to respond**:
6363
* If all the following conditions are met, try to add a comment to the
64-
discussion, otherwise, do not respond:
64+
discussion; otherwise, do not respond:
6565
- The discussion is not closed.
6666
- The latest comment is not from you or other agents (marked as
6767
"Response from XXX Agent").
@@ -102,7 +102,7 @@
102102
* You **should always** use the `convert_gcs_links_to_https` tool to convert
103103
GCS links (e.g. "gs://...") to HTTPS links.
104104
* **Do not** use the `convert_gcs_links_to_https` tool for non-GCS links.
105-
* Make sure the citation URL is valid. Otherwise do not list this specific
105+
* Make sure the citation URL is valid. Otherwise, do not list this specific
106106
citation.
107107
* Do not respond to any other discussion except the one specified by the user.
108108

contributing/samples/adk_answering_agent/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def convert_gcs_to_https(gcs_uri: str) -> Optional[str]:
128128

129129
base_url = "https://google.github.io/adk-docs/"
130130
if os.path.basename(path_after_docs) == "index.md":
131-
# Use the directory path if it is a index file
131+
# Use the directory path if it is an index file
132132
final_path_segment = os.path.dirname(path_after_docs)
133133
else:
134134
# Otherwise, use the file name without extension

contributing/samples/adk_documentation/adk_docs_updater/agent.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
),
5555
instruction=f"""
5656
# 1. Identity
57-
You are a helper bot that updates ADK docs in Github Repository {DOC_OWNER}/{DOC_REPO}
58-
based on the code in the ADK Python codebase in Github Repository {CODE_OWNER}/{CODE_REPO} according to the instructions in the ADK docs issues.
57+
You are a helper bot that updates ADK docs in GitHub Repository {DOC_OWNER}/{DOC_REPO}
58+
based on the code in the ADK Python codebase in GitHub Repository {CODE_OWNER}/{CODE_REPO} according to the instructions in the ADK docs issues.
5959
60-
You are very familiar with Github, expecially how to search for files in a Github repository using git grep.
60+
You are very familiar with GitHub, especially how to search for files in a GitHub repository using git grep.
6161
6262
# 2. Responsibilities
6363
Your core responsibility includes:
@@ -69,18 +69,18 @@
6969
# 3. Workflow
7070
1. Always call the `clone_or_pull_repo` tool to make sure the ADK docs and codebase repos exist in the local folder {LOCAL_REPOS_DIR_PATH}/repo_name and are the latest version.
7171
2. Read and analyze the issue specified by user.
72-
- If user only specified the issue number, call the `get_issue` tool to get the issue details, otherwise use the issue details provided by user directly.
72+
- If user only specified the issue number, call the `get_issue` tool to get the issue details; otherwise, use the issue details provided by user directly.
7373
3. If the issue contains instructions about how to update the ADK docs, follow the instructions to update the ADK docs.
7474
4. Understand the doc update instructions.
7575
- Ignore and skip the instructions about updating API reference docs, since it will be automatically generated by the ADK team.
7676
5. Read the doc to update using the `read_local_git_repo_file_content` tool from the local ADK docs repo under {LOCAL_REPOS_DIR_PATH}/{DOC_REPO}.
7777
6. Find the related Python files in the ADK Python codebase.
78-
- If the doc update instructions specify paths to the Python files, use them directly, otherwise use a list of regex search patterns to find the related Python files through the `search_local_git_repo` tool.
78+
- If the doc update instructions specify paths to the Python files, use them directly; otherwise, use a list of regex search patterns to find the related Python files through the `search_local_git_repo` tool.
7979
- You should focus on the main ADK Python codebase, ignore the changes in tests or other auxiliary files.
8080
- You should find all the related Python files, not only the most relevant one.
8181
7. Read the specified or found Python files using the `read_local_git_repo_file_content` tool to find all the related code.
82-
- You can ignore unit test files, unless you are sure that the test code is uesful to understand the related concepts.
83-
- You should read all the the found files to find all the related code, unless you already know the content of the file or you are sure that the file is not related to the ADK doc.
82+
- You can ignore unit test files, unless you are sure that the test code is useful to understand the related concepts.
83+
- You should read all the found files to find all the related code, unless you already know the content of the file or you are sure that the file is not related to the ADK doc.
8484
8. Update the ADK doc file according to the doc update instructions and the related code.
8585
- Use active voice phrasing in your doc updates.
8686
- Use second person "you" form of address in your doc updates.
@@ -102,7 +102,7 @@
102102
- **File Paths:** Always use absolute paths when calling the tools to read files, list directories, or search the codebase.
103103
- **Tool Call Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
104104
- **Avoid deletion:** Do not delete any existing content unless specifically directed to do so.
105-
- **Explaination:** Provide concise explanations for your actions and reasoning for each step.
105+
- **Explanation:** Provide concise explanations for your actions and reasoning for each step.
106106
- **Minimize changes:** When making updates to documentation pages, make the minimum amount of changes to achieve the communication goal. Only make changes that are necessary, and leave everything else as-is.
107107
- **Avoid trivial code sample changes:** Update code samples only when adding or modifying functionality. Do not reformat code samples, change variable names, or change code syntax unless you are specifically directed to make those updates.
108108

contributing/samples/adk_documentation/adk_release_analyzer/agent.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@
5656
),
5757
instruction=f"""
5858
# 1. Identity
59-
You are a helper bot that checks if ADK docs in Github Repository {DOC_REPO} owned by {DOC_OWNER}
60-
should be updated based on the changes in the ADK Python codebase in Github Repository {CODE_REPO} owned by {CODE_OWNER}.
59+
You are a helper bot that checks if ADK docs in GitHub Repository {DOC_REPO} owned by {DOC_OWNER}
60+
should be updated based on the changes in the ADK Python codebase in GitHub Repository {CODE_REPO} owned by {CODE_OWNER}.
6161
62-
You are very familiar with Github, expecially how to search for files in a Github repository using git grep.
62+
You are very familiar with GitHub, especially how to search for files in a GitHub repository using git grep.
6363
6464
# 2. Responsibilities
6565
Your core responsibility includes:
6666
- Find all the code changes between the two ADK releases.
6767
- Find **all** the related docs files in ADK Docs repository under the "/docs/" directory.
6868
- Compare the code changes with the docs files and analyze the differences.
69-
- Write the instructions about how to update the ADK docs in markdown format and create a Github issue in the Github Repository {DOC_REPO} with the instructions.
69+
- Write the instructions about how to update the ADK docs in markdown format and create a GitHub issue in the GitHub Repository {DOC_REPO} with the instructions.
7070
7171
# 3. Workflow
7272
1. Always call the `clone_or_pull_repo` tool to make sure the ADK docs and codebase repos exist in the local folder {LOCAL_REPOS_DIR_PATH}/repo_name and are the latest version.
@@ -102,8 +102,8 @@
102102
**Reference**:
103103
Reference to the code file (e.g. src/google/adk/tools/spanner/metadata_tool.py).
104104
```
105-
- When referncing doc file, use the full relative path of the doc file in the ADK Docs repository (e.g. docs/sessions/memory.md).
106-
9. Create or recommend to create a Github issue in the Github Repository {DOC_REPO} with the instructions using the `create_issue` tool.
105+
- When referencing doc file, use the full relative path of the doc file in the ADK Docs repository (e.g. docs/sessions/memory.md).
106+
9. Create or recommend to create a GitHub issue in the GitHub Repository {DOC_REPO} with the instructions using the `create_issue` tool.
107107
- The title of the issue should be "Found docs updates needed from ADK python release <start_tag> to <end_tag>", where start_tag and end_tag are the release tags.
108108
- The body of the issue should be the instructions about how to update the ADK docs.
109109
- Include the compare link between the two ADK releases in the issue body, e.g. https://github.com/google/adk-python/compare/v1.14.0...v1.14.1.
@@ -112,7 +112,7 @@
112112
# 4. Guidelines & Rules
113113
- **File Paths:** Always use absolute paths when calling the tools to read files, list directories, or search the codebase.
114114
- **Tool Call Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
115-
- **Explaination:** Provide concise explanations for your actions and reasoning for each step.
115+
- **Explanation:** Provide concise explanations for your actions and reasoning for each step.
116116
- **Reference:** For each recommended change, reference the code changes (i.e. links to the commits) **AND** the code files (i.e. relative paths to the code files in the codebase).
117117
- **Sorting:** Sort the recommended changes by the importance of the changes, from the most important to the least important.
118118
- Here are the importance groups: Feature changes > Bug fixes > Other changes.

contributing/samples/adk_documentation/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def get_issue(
392392
Args:
393393
repo_owner: The name of the repository owner.
394394
repo_name: The name of the repository.
395-
issue_number: issue number of the Github issue.
395+
issue_number: issue number of the GitHub issue.
396396
397397
Returns:
398398
The status of this request, with the issue details when successful.

0 commit comments

Comments
 (0)