Skip to content

Commit 29fb6d4

Browse files
authored
Merge branch 'main' into a2a-url
2 parents 9352e83 + 88f759a commit 29fb6d4

File tree

114 files changed

+3635
-513
lines changed

Some content is hidden

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

114 files changed

+3635
-513
lines changed

.github/workflows/discussion_answering.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ name: ADK Answering Agent for Discussions
33
on:
44
discussion:
55
types: [created]
6-
discussion_comment:
7-
types: [created]
86

97
jobs:
108
agent-answer-questions:
9+
if: github.event.discussion.category.name == 'Q&A'
1110
runs-on: ubuntu-latest
1211

1312
steps:
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Upload ADK Docs to Vertex AI Search
2+
3+
on:
4+
# Runs once per day at 16:00 UTC
5+
schedule:
6+
- cron: '00 16 * * *'
7+
# Manual trigger for testing and fixing
8+
workflow_dispatch:
9+
10+
jobs:
11+
upload-adk-docs-to-vertex-ai-search:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Clone adk-docs repository
19+
run: git clone https://github.com/google/adk-docs.git /tmp/adk-docs
20+
21+
- name: Clone adk-python repository
22+
run: git clone https://github.com/google/adk-python.git /tmp/adk-python
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Authenticate to Google Cloud
30+
id: auth
31+
uses: 'google-github-actions/auth@v2'
32+
with:
33+
credentials_json: '${{ secrets.ADK_GCP_SA_KEY }}'
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install google-adk markdown google-cloud-storage google-cloud-discoveryengine
39+
40+
- name: Run Answering Script
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }}
43+
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
44+
GOOGLE_CLOUD_LOCATION: ${{ secrets.GOOGLE_CLOUD_LOCATION }}
45+
VERTEXAI_DATASTORE_ID: ${{ secrets.VERTEXAI_DATASTORE_ID }}
46+
GOOGLE_GENAI_USE_VERTEXAI: 1
47+
GCS_BUCKET_NAME: ${{ secrets.GCS_BUCKET_NAME }}
48+
ADK_DOCS_ROOT_PATH: /tmp/adk-docs
49+
ADK_PYTHON_ROOT_PATH: /tmp/adk-python
50+
PYTHONPATH: contributing/samples
51+
run: python -m adk_answering_agent.upload_docs_to_vertex_ai_search

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Changelog
22

3+
## [1.10.0](https://github.com/google/adk-python/compare/v1.9.0...v1.10.0) (2025-08-07)
4+
5+
### Features
6+
7+
* [Live] Implement Live Session Resumption ([71fbc92](https://github.com/google/adk-python/commit/71fbc9275b3d74700ec410cb4155ba0cb18580b7))
8+
* [Tool] Support parallel execution of parallel function calls ([57cd41f](https://github.com/google/adk-python/commit/57cd41f424b469fb834bb8f2777b5f7be9aa6cdf))
9+
* [Models] Allow max tokens to be customizable in Claude ([7556ebc](https://github.com/google/adk-python/commit/7556ebc76abd3c776922c2803aed831661cf7f82))
10+
* [Tool] Create enterprise_web_search_tool as a tool instance ([0e28d64](https://github.com/google/adk-python/commit/0e28d64712e481cfd3b964be0166f529657024f6))
11+
12+
### Bug Fixes
13+
14+
* Fix shared default plugin manager and cost manager instances among multiple invocations ([423542a](https://github.com/google/adk-python/commit/423542a43fb8316195e9f79d97f87593751bebd3))
15+
* Correct the type annotation in anthropic_llm implementation ([97318bc](https://github.com/google/adk-python/commit/97318bcd199acdacadfe8664da3fbfc3c806cdd2))
16+
* Fix adk deploy cloud_run cli, which was broken in v1.9.0 ([e41dbcc](https://github.com/google/adk-python/commit/e41dbccf7f610e249108f9321f60f71fe2cc10f4))
17+
* Remove thoughts from contents in llm requests from history contents ([d620bcb](https://github.com/google/adk-python/commit/d620bcb384d3068228ea2059fb70274e68e69682))
18+
* Annotate response type as None for transfer_to_agent tool ([86a4487](https://github.com/google/adk-python/commit/86a44873e9b2dfc7e62fa31a9ac3be57c0bbff7b))
19+
* Fix incompatible a2a sdk changes ([faadef1](https://github.com/google/adk-python/commit/faadef167ee8e4dd1faf4da5685a577c3155556e))
20+
* Fix adk cli options and method parameters mismatching ([8ef2177](https://github.com/google/adk-python/commit/8ef2177658fbfc74b1a74b0c3ea8150bae866796))
21+
22+
### Improvements
23+
24+
* Add Github workflow config for the ADK Answering agent ([8dc0c94](https://github.com/google/adk-python/commit/8dc0c949afb9024738ff7ac1b2c19282175c3200))
25+
* Import AGENT_CARD_WELL_KNOWN_PATH from adk instead of from a2a directly ([37dae9b](https://github.com/google/adk-python/commit/37dae9b631db5060770b66fce0e25cf0ffb56948))
26+
* Make `LlmRequest.LiveConnectConfig` field default to a factory ([74589a1](https://github.com/google/adk-python/commit/74589a1db7df65e319d1ad2f0676ee0cf5d6ec1d))
27+
* Update the prompt to make the ADK Answering Agent more objective ([2833030](https://github.com/google/adk-python/commit/283303032a174d51b8d72f14df83c794d66cb605))
28+
* Add sample agent for testing parallel functions execution ([90b9193](https://github.com/google/adk-python/commit/90b9193a20499b8dd7f57d119cda4c534fcfda10))
29+
* Hide the ask_data_insights tool until the API is publicly available ([bead607](https://github.com/google/adk-python/commit/bead607364be7ac8109357c9d3076d9b345e9e8a))
30+
* Change `LlmRequest.config`'s default value to be `types.GenerateContentConfig()` ([041f04e](https://github.com/google/adk-python/commit/041f04e89cee30532facccce4900d10f1b8c69ce))
31+
* Prevent triggering of _load_from_yaml_config in AgentLoader ([db975df](https://github.com/google/adk-python/commit/db975dfe2a09a6d056d02bc03c1247ac10f6da7d))
32+
33+
### Documentation
34+
35+
* Fix typos ([16a15c8](https://github.com/google/adk-python/commit/16a15c8709b47c9bebe7cffe888e8e7e48ec605a))
36+
37+
338
## [1.9.0](https://github.com/google/adk-python/compare/v1.8.0...v1.9.0) (2025-07-31)
439

540

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Agent Development Kit (ADK)
22

33
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
4+
[![PyPI](https://img.shields.io/pypi/v/google-adk)](https://pypi.org/project/google-adk/)
45
[![Python Unit Tests](https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml/badge.svg)](https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml)
56
[![r/agentdevelopmentkit](https://img.shields.io/badge/Reddit-r%2Fagentdevelopmentkit-FF4500?style=flat&logo=reddit&logoColor=white)](https://www.reddit.com/r/agentdevelopmentkit/)
67
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/google/adk-python)
@@ -14,7 +15,7 @@
1415
</h3>
1516
<h3 align="center">
1617
Important Links:
17-
<a href="https://google.github.io/adk-docs/">Docs</a>,
18+
<a href="https://google.github.io/adk-docs/">Docs</a>,
1819
<a href="https://github.com/google/adk-samples">Samples</a>,
1920
<a href="https://github.com/google/adk-java">Java ADK</a> &
2021
<a href="https://github.com/google/adk-web">ADK Web</a>.

contributing/samples/adk_answering_agent/agent.py

Lines changed: 7 additions & 201 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Any
16-
1715
from adk_answering_agent.settings import BOT_RESPONSE_LABEL
1816
from adk_answering_agent.settings import IS_INTERACTIVE
1917
from adk_answering_agent.settings import OWNER
2018
from adk_answering_agent.settings import REPO
2119
from adk_answering_agent.settings import VERTEXAI_DATASTORE_ID
22-
from adk_answering_agent.utils import error_response
23-
from adk_answering_agent.utils import run_graphql_query
20+
from adk_answering_agent.tools import add_comment_to_discussion
21+
from adk_answering_agent.tools import add_label_to_discussion
22+
from adk_answering_agent.tools import convert_gcs_links_to_https
23+
from adk_answering_agent.tools import get_discussion_and_comments
2424
from google.adk.agents.llm_agent import Agent
2525
from google.adk.tools.vertex_ai_search_tool import VertexAiSearchTool
26-
import requests
2726

2827
if IS_INTERACTIVE:
2928
APPROVAL_INSTRUCTION = (
@@ -35,191 +34,6 @@
3534
" comment."
3635
)
3736

38-
39-
def get_discussion_and_comments(discussion_number: int) -> dict[str, Any]:
40-
"""Fetches a discussion and its comments using the GitHub GraphQL API.
41-
42-
Args:
43-
discussion_number: The number of the GitHub discussion.
44-
45-
Returns:
46-
A dictionary with the request status and the discussion details.
47-
"""
48-
print(f"Attempting to get discussion #{discussion_number} and its comments")
49-
query = """
50-
query($owner: String!, $repo: String!, $discussionNumber: Int!) {
51-
repository(owner: $owner, name: $repo) {
52-
discussion(number: $discussionNumber) {
53-
id
54-
title
55-
body
56-
createdAt
57-
closed
58-
author {
59-
login
60-
}
61-
# For each discussion, fetch the latest 20 labels.
62-
labels(last: 20) {
63-
nodes {
64-
id
65-
name
66-
}
67-
}
68-
# For each discussion, fetch the latest 100 comments.
69-
comments(last: 100) {
70-
nodes {
71-
id
72-
body
73-
createdAt
74-
author {
75-
login
76-
}
77-
# For each discussion, fetch the latest 50 replies
78-
replies(last: 50) {
79-
nodes {
80-
id
81-
body
82-
createdAt
83-
author {
84-
login
85-
}
86-
}
87-
}
88-
}
89-
}
90-
}
91-
}
92-
}
93-
"""
94-
variables = {
95-
"owner": OWNER,
96-
"repo": REPO,
97-
"discussionNumber": discussion_number,
98-
}
99-
try:
100-
response = run_graphql_query(query, variables)
101-
if "errors" in response:
102-
return error_response(str(response["errors"]))
103-
discussion_data = (
104-
response.get("data", {}).get("repository", {}).get("discussion")
105-
)
106-
if not discussion_data:
107-
return error_response(f"Discussion #{discussion_number} not found.")
108-
return {"status": "success", "discussion": discussion_data}
109-
except requests.exceptions.RequestException as e:
110-
return error_response(str(e))
111-
112-
113-
def add_comment_to_discussion(
114-
discussion_id: str, comment_body: str
115-
) -> dict[str, Any]:
116-
"""Adds a comment to a specific discussion.
117-
118-
Args:
119-
discussion_id: The GraphQL node ID of the discussion.
120-
comment_body: The content of the comment in Markdown.
121-
122-
Returns:
123-
The status of the request and the new comment's details.
124-
"""
125-
print(f"Adding comment to discussion {discussion_id}")
126-
query = """
127-
mutation($discussionId: ID!, $body: String!) {
128-
addDiscussionComment(input: {discussionId: $discussionId, body: $body}) {
129-
comment {
130-
id
131-
body
132-
createdAt
133-
author {
134-
login
135-
}
136-
}
137-
}
138-
}
139-
"""
140-
variables = {"discussionId": discussion_id, "body": comment_body}
141-
try:
142-
response = run_graphql_query(query, variables)
143-
if "errors" in response:
144-
return error_response(str(response["errors"]))
145-
new_comment = (
146-
response.get("data", {}).get("addDiscussionComment", {}).get("comment")
147-
)
148-
return {"status": "success", "comment": new_comment}
149-
except requests.exceptions.RequestException as e:
150-
return error_response(str(e))
151-
152-
153-
def get_label_id(label_name: str) -> str | None:
154-
"""Helper function to find the GraphQL node ID for a given label name."""
155-
print(f"Finding ID for label '{label_name}'...")
156-
query = """
157-
query($owner: String!, $repo: String!, $labelName: String!) {
158-
repository(owner: $owner, name: $repo) {
159-
label(name: $labelName) {
160-
id
161-
}
162-
}
163-
}
164-
"""
165-
variables = {"owner": OWNER, "repo": REPO, "labelName": label_name}
166-
167-
try:
168-
response = run_graphql_query(query, variables)
169-
if "errors" in response:
170-
print(
171-
f"[Warning] Error from GitHub API response for label '{label_name}':"
172-
f" {response['errors']}"
173-
)
174-
return None
175-
label_info = response["data"].get("repository", {}).get("label")
176-
if label_info:
177-
return label_info.get("id")
178-
print(f"[Warning] Label information for '{label_name}' not found.")
179-
return None
180-
except requests.exceptions.RequestException as e:
181-
print(f"[Warning] Error from GitHub API: {e}")
182-
return None
183-
184-
185-
def add_label_to_discussion(
186-
discussion_id: str, label_name: str
187-
) -> dict[str, Any]:
188-
"""Adds a label to a specific discussion.
189-
190-
Args:
191-
discussion_id: The GraphQL node ID of the discussion.
192-
label_name: The name of the label to add (e.g., "bug").
193-
194-
Returns:
195-
The status of the request and the label details.
196-
"""
197-
print(
198-
f"Attempting to add label '{label_name}' to discussion {discussion_id}..."
199-
)
200-
# First, get the GraphQL ID of the label by its name
201-
label_id = get_label_id(label_name)
202-
if not label_id:
203-
return error_response(f"Label '{label_name}' not found.")
204-
205-
# Then, perform the mutation to add the label to the discussion
206-
mutation = """
207-
mutation AddLabel($discussionId: ID!, $labelId: ID!) {
208-
addLabelsToLabelable(input: {labelableId: $discussionId, labelIds: [$labelId]}) {
209-
clientMutationId
210-
}
211-
}
212-
"""
213-
variables = {"discussionId": discussion_id, "labelId": label_id}
214-
try:
215-
response = run_graphql_query(mutation, variables)
216-
if "errors" in response:
217-
return error_response(str(response["errors"]))
218-
return {"status": "success", "label_id": label_id, "label_name": label_name}
219-
except requests.exceptions.RequestException as e:
220-
return error_response(str(e))
221-
222-
22337
root_agent = Agent(
22438
model="gemini-2.5-pro",
22539
name="adk_answering_agent",
@@ -249,28 +63,20 @@ def add_label_to_discussion(
24963
information that is not in the document store. Do not invent citations which are not in the document store.
25064
* **Be Objective**: your answer should be based on the facts you found in the document store, do not be misled by user's assumptions or user's understanding of ADK.
25165
* If you can't find the answer or information in the document store, **do not** respond.
252-
* Include a bolded note (e.g. "Response from ADK Answering Agent") in your comment
253-
to indicate this comment was added by an ADK Answering Agent.
254-
* Have an empty line between the note and the rest of your response.
25566
* Inlclude a short summary of your response in the comment as a TLDR, e.g. "**TLDR**: <your summary>".
25667
* Have a divider line between the TLDR and your detail response.
25768
* Do not respond to any other discussion except the one specified by the user.
25869
* Please include your justification for your decision in your output
25970
to the user who is telling with you.
26071
* If you uses citation from the document store, please provide a footnote
261-
referencing the source document format it as: "[1] URL of the document".
262-
* Replace the "gs://prefix/" part, e.g. "gs://adk-qa-bucket/", to be "https://github.com/google/"
263-
* Add "blob/main/" after the repo name, e.g. "adk-python", "adk-docs", for example:
264-
* If the original URL is "gs://adk-qa-bucket/adk-python/src/google/adk/version.py",
265-
then the citation URL is "https://github.com/google/adk-python/blob/main/src/google/adk/version.py",
266-
* If the original URL is "gs://adk-qa-bucket/adk-docs/docs/index.md",
267-
then the citation URL is "https://github.com/google/adk-docs/blob/main/docs/index.md"
268-
* If the file is a html file, replace the ".html" to be ".md"
72+
referencing the source document format it as: "[1] publicly accessible HTTPS URL of the document".
73+
* You can use the `convert_gcs_links_to_https` tool to convert GCS links to HTTPS links.
26974
""",
27075
tools=[
27176
VertexAiSearchTool(data_store_id=VERTEXAI_DATASTORE_ID),
27277
get_discussion_and_comments,
27378
add_comment_to_discussion,
27479
add_label_to_discussion,
80+
convert_gcs_links_to_https,
27581
],
27682
)

0 commit comments

Comments
 (0)