Skip to content

Commit 0901370

Browse files
authored
Merge branch 'main' into fix/memory-leak-delete-session
2 parents 35b521b + 20f863f commit 0901370

92 files changed

Lines changed: 1684 additions & 1961 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.

.devcontainer/devcontainer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"vscode": {
1010
"extensions": [
1111
"extension-pack-for-java",
12-
"redhat.vscode-xml",
13-
"rangav.vscode-thunder-client"
12+
"redhat.vscode-xml"
1413
],
1514
"settings": {
1615
"java.jdt.download.server": "latest",
@@ -24,5 +23,8 @@
2423
},
2524
"remoteUser": "vscode",
2625
"forwardPorts": [8000, 8080, 8081, 8082],
27-
"postCreateCommand": "git config --global credential.helper '!gh auth git-credential' && git config --global lfs.locksverify false"
26+
"postCreateCommand": "git config --global credential.helper '!gh auth git-credential' && git config --global lfs.locksverify false",
27+
"hostRequirements": {
28+
"cpus": 4
29+
}
2830
}

.github/workflows/release-please.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
steps:
1515
- uses: googleapis/release-please-action@v4
1616
with:
17-
token: ${{ secrets.GITHUB_TOKEN }}
17+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.7.0"
2+
".": "0.8.0"
33
}

CHANGELOG.md

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

3+
## [0.8.0](https://github.com/google/adk-java/compare/v0.7.0...v0.8.0) (2026-03-06)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* remove methods with Optional params from LiveRequest.Builder
9+
* remove deprecated methods accepting Optional params in InvocationContext
10+
* remove deprecated BaseToolset.isToolSelected method
11+
* remove Optional parameters from LlmResponse.Builder's methods
12+
* remove support for legacy `transferToAgent`, superseded by `transfer_to_agent`
13+
14+
### Features
15+
16+
* add callbacks functionality to the agent executor ([7e8f9dc](https://github.com/google/adk-java/commit/7e8f9dcf82fe7e62aee625fbfaa8673d238ff184))
17+
* add example on how to expose agent via A2A protocol ([e3ea378](https://github.com/google/adk-java/commit/e3ea378051e5c4e5e5031657467145779e42db55))
18+
* Adding a Builder for EventsCompactionConfig ([05fbcfc](https://github.com/google/adk-java/commit/05fbcfc933923ae711cd12e7fc9e587fd8e2685c))
19+
* Adding a SessionKey for typeSafety ([d899f6f](https://github.com/google/adk-java/commit/d899f6f4ad52c84cb4ac8c90d0dc88c22487029c))
20+
* Adding plugin(Plugin... p) helper methods on App and Runner builders ([dc1a192](https://github.com/google/adk-java/commit/dc1a192a81a92870aa5a4af27a9dc90e81cdaf67))
21+
* implement partial event aggregation in RemoteA2AAgent ([e064067](https://github.com/google/adk-java/commit/e0640673d212b9849d312953f192f8da51fae85b))
22+
* remove deprecated BaseToolset.isToolSelected method ([d2f1145](https://github.com/google/adk-java/commit/d2f11456c3a99edd43b3dc0d04743ae7e9390ded))
23+
* remove deprecated methods accepting Optional params in InvocationContext ([88153c8](https://github.com/google/adk-java/commit/88153c833697a9b9c6ec735a69f48a92cbdfc54b))
24+
* remove methods with Optional params from LiveRequest.Builder ([84c62a4](https://github.com/google/adk-java/commit/84c62a48ef7b62641722824fe5ba1200606b7b17))
25+
* remove Optional parameters from LlmResponse.Builder's methods ([a3ac436](https://github.com/google/adk-java/commit/a3ac436bcfa241e90c07485e5da918ec8dbc2b4a))
26+
27+
28+
### Bug Fixes
29+
30+
* Allow injecting ObjectMapper in FunctionTool, default to ObjectMapper (re. [#473](https://github.com/google/adk-java/issues/473)) ([71b1070](https://github.com/google/adk-java/commit/71b10701e753bddaa96d5e6579b759d2b9bb3e92))
31+
* downgrade otel.version to 1.51.0 ([117fedf](https://github.com/google/adk-java/commit/117fedf672bb67c4b078ac75ee81a7710452c5b5))
32+
* Ensure Gemini 3.1 models have events correctly buffered ([acffdb9](https://github.com/google/adk-java/commit/acffdb96bcd8133af99cb0b9426665ba73a83bbc))
33+
* Exit from rearrangeEventsForLatestFunctionResponse if size of events is less than 2 ([5bc3ef8](https://github.com/google/adk-java/commit/5bc3ef89e62eb3f32ba7e45657c9e40c88c3a5e9))
34+
* Fixed issue where events were marked empty if the first part had an empty text; now checks all parts for meaningful content ([a0cba25](https://github.com/google/adk-java/commit/a0cba25d691f4be72bea22b0649ecf2d2c110736))
35+
* prepare JSON serialization for Jackson 2.20.2 and Spring Boot 4.0.2 upgrades ([8c6591b](https://github.com/google/adk-java/commit/8c6591bc4ad86c376cdd70e1bb64f359fbf22fe9))
36+
37+
38+
### Miscellaneous Chores
39+
40+
* revert: switch release please secret to use adk-java-releases-bot's token ([7eafd1b](https://github.com/google/adk-java/commit/7eafd1bd9b16e9ed83dfbc3d0983cfc415c0aaec))
41+
42+
43+
### Code Refactoring
44+
45+
* remove support for legacy `transferToAgent`, superseded by `transfer_to_agent` ([c1ccb2e](https://github.com/google/adk-java/commit/c1ccb2e9d375fedcd7dbb594300e66a1a0488a91))
46+
347
## [0.7.0](https://github.com/google/adk-java/compare/v0.6.0...v0.7.0) (2026-02-27)
448

549

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ If you're using Maven, add the following to your dependencies:
5050
<dependency>
5151
<groupId>com.google.adk</groupId>
5252
<artifactId>google-adk</artifactId>
53-
<version>0.7.0</version>
53+
<version>0.8.0</version>
5454
</dependency>
5555
<!-- Dev UI -->
5656
<dependency>
5757
<groupId>com.google.adk</groupId>
5858
<artifactId>google-adk-dev</artifactId>
59-
<version>0.7.0</version>
59+
<version>0.8.0</version>
6060
</dependency>
6161
```
6262

a2a/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.adk</groupId>
77
<artifactId>google-adk-parent</artifactId>
8-
<version>0.7.1-SNAPSHOT</version><!-- {x-version-update:google-adk:current} -->
8+
<version>0.8.1-SNAPSHOT</version><!-- {x-version-update:google-adk:current} -->
99
</parent>
1010

1111
<artifactId>google-adk-a2a</artifactId>

a2a/src/main/java/com/google/adk/a2a/RemoteA2AAgent.java renamed to a2a/src/main/java/com/google/adk/a2a/agent/RemoteA2AAgent.java

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
package com.google.adk.a2a;
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.adk.a2a.agent;
217

318
import static com.google.common.base.Strings.nullToEmpty;
419

@@ -44,26 +59,21 @@
4459
import org.slf4j.LoggerFactory;
4560

4661
/**
47-
* Agent that communicates with a remote A2A agent via A2A client.
48-
*
49-
* <p>This agent supports multiple ways to specify the remote agent:
62+
* Agent that communicates with a remote A2A agent via an A2A client.
5063
*
51-
* <ol>
52-
* <li>Direct AgentCard object
53-
* <li>URL to agent card JSON
54-
* <li>File path to agent card JSON
55-
* </ol>
64+
* <p>The remote agent can be specified directly by providing an {@link AgentCard} to the builder,
65+
* or it can be resolved automatically using the provided A2A client.
5666
*
57-
* <p>The agent handles:
67+
* <p>Key responsibilities of this agent include:
5868
*
5969
* <ul>
6070
* <li>Agent card resolution and validation
61-
* <li>A2A message conversion and error handling
62-
* <li>Session state management across requests
71+
* <li>Converting ADK session history events into A2A requests ({@link io.a2a.spec.Message})
72+
* <li>Handling streaming and non-streaming responses from the A2A client
73+
* <li>Buffering and aggregating streamed response chunks into ADK {@link
74+
* com.google.adk.events.Event}s
75+
* <li>Converting A2A client responses back into ADK format
6376
* </ul>
64-
*
65-
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
66-
* use in production code.
6777
*/
6878
public class RemoteA2AAgent extends BaseAgent {
6979

@@ -436,7 +446,7 @@ private boolean mergeAggregatedContentIntoEvent(Event event) {
436446
}
437447
Content aggregatedContent = Content.builder().role("model").parts(parts).build();
438448

439-
event.setContent(Optional.of(aggregatedContent));
449+
event.setContent(aggregatedContent);
440450

441451
ImmutableList.Builder<CustomMetadata> newMetadata = ImmutableList.builder();
442452
event.customMetadata().ifPresent(newMetadata::addAll);

a2a/src/main/java/com/google/adk/a2a/common/A2AClientError.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.google.adk.a2a.common;
217

318
/** Exception thrown when the A2A client encounters an error. */

a2a/src/main/java/com/google/adk/a2a/common/A2AMetadata.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.google.adk.a2a.common;
217

318
/** Constants and utilities for A2A metadata keys. */
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.adk.a2a.common;
17+
18+
/** Exception thrown when the the genai class has an empty field. */
19+
public class GenAiFieldMissingException extends RuntimeException {
20+
public GenAiFieldMissingException(String message) {
21+
super(message);
22+
}
23+
24+
public GenAiFieldMissingException(String message, Throwable cause) {
25+
super(message, cause);
26+
}
27+
}

0 commit comments

Comments
 (0)