Skip to content

Commit 485c8f8

Browse files
authored
Merge pull request #6 from ddobrin/main
Merge main into planner
2 parents 3759169 + 1a87114 commit 485c8f8

Some content is hidden

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

46 files changed

+763
-733
lines changed

.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 }}

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. */

a2a/src/main/java/com/google/adk/a2a/common/GenAiFieldMissingException.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 the genai class has an empty field. */

a2a/src/main/java/com/google/adk/a2a/converters/A2ADataPartMetadataType.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.converters;
217

318
/** Enum for the type of A2A DataPart metadata. */

a2a/src/main/java/com/google/adk/a2a/converters/EventConverter.java

Lines changed: 16 additions & 6 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.converters;
217

318
import static com.google.common.collect.ImmutableList.toImmutableList;
@@ -13,12 +28,7 @@
1328
import org.slf4j.Logger;
1429
import org.slf4j.LoggerFactory;
1530

16-
/**
17-
* Converter for ADK Events to A2A Messages.
18-
*
19-
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
20-
* use in production code.
21-
*/
31+
/** Converter for ADK Events to A2A Messages. */
2232
public final class EventConverter {
2333
private static final Logger logger = LoggerFactory.getLogger(EventConverter.class);
2434

a2a/src/main/java/com/google/adk/a2a/converters/PartConverter.java

Lines changed: 16 additions & 6 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.converters;
217

318
import static com.google.common.collect.ImmutableList.toImmutableList;
@@ -32,12 +47,7 @@
3247
import org.slf4j.Logger;
3348
import org.slf4j.LoggerFactory;
3449

35-
/**
36-
* Utility class for converting between Google GenAI Parts and A2A DataParts.
37-
*
38-
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
39-
* use in production code.
40-
*/
50+
/** Utility class for converting between Google GenAI Parts and A2A DataParts. */
4151
public final class PartConverter {
4252

4353
private static final Logger logger = LoggerFactory.getLogger(PartConverter.class);

a2a/src/main/java/com/google/adk/a2a/converters/ResponseConverter.java

Lines changed: 17 additions & 7 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.converters;
217

318
import static com.google.common.collect.ImmutableList.toImmutableList;
@@ -27,12 +42,7 @@
2742
import org.slf4j.Logger;
2843
import org.slf4j.LoggerFactory;
2944

30-
/**
31-
* Utility for converting ADK events to A2A spec messages (and back).
32-
*
33-
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
34-
* use in production code.
35-
*/
45+
/** Utility for converting ADK events to A2A spec messages (and back). */
3646
public final class ResponseConverter {
3747
private static final Logger logger = LoggerFactory.getLogger(ResponseConverter.class);
3848
private static final ImmutableSet<TaskState> PENDING_STATES =
@@ -76,7 +86,7 @@ private static Optional<Event> handleTaskUpdate(
7686
boolean isLastChunk = Objects.equals(artifactEvent.isLastChunk(), true);
7787

7888
Event eventPart = artifactToEvent(artifactEvent.getArtifact(), context);
79-
eventPart.setPartial(Optional.of(isAppend || !isLastChunk));
89+
eventPart.setPartial(isAppend || !isLastChunk);
8090
// append=true, lastChunk=false: emit as partial, update aggregation
8191
// append=false, lastChunk=false: emit as partial, reset aggregation
8292
// append=true, lastChunk=true: emit as partial, update aggregation and emit as non-partial

a2a/src/main/java/com/google/adk/a2a/executor/AgentExecutor.java

Lines changed: 16 additions & 6 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.executor;
217

318
import static java.util.Objects.requireNonNull;
@@ -44,12 +59,7 @@
4459
import org.slf4j.Logger;
4560
import org.slf4j.LoggerFactory;
4661

47-
/**
48-
* Implementation of the A2A AgentExecutor interface that uses ADK to execute agent tasks.
49-
*
50-
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
51-
* use in production code.
52-
*/
62+
/** Implementation of the A2A AgentExecutor interface that uses ADK to execute agent tasks. */
5363
public class AgentExecutor implements io.a2a.server.agentexecution.AgentExecutor {
5464
private static final Logger logger = LoggerFactory.getLogger(AgentExecutor.class);
5565
private static final String USER_ID_PREFIX = "A2A_USER_";

0 commit comments

Comments
 (0)