Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
11ce49e
chore: switch release please secret to use adk-java-releases-bot's token
tilgalas Mar 6, 2026
67b602f
feat!: use @Nullable fields in Event class
tilgalas Mar 6, 2026
82ef5ac
feat!: remove McpAsyncToolset constructors
tilgalas Mar 9, 2026
5e4eaa4
refactor: remove use of Optional params in Contents class
tilgalas Mar 9, 2026
1cb4d43
refactor: Move RemoteA2AAgent to agent package; remove EXPERIMENTAL a…
google-genai-bot Mar 9, 2026
5e1e1d4
feat!: Remove deprecated create method in ResponseProcessor
tilgalas Mar 9, 2026
a86ede0
feat!: remove deprecated url method in ComputerState.Builder
tilgalas Mar 9, 2026
143b656
feat: update return type for requestedToolConfirmations getter and se…
google-genai-bot Mar 9, 2026
973f887
feat: Fixing the spans produced by agent calls to have the right pare…
google-genai-bot Mar 9, 2026
3c8f488
feat: Fixing the spans produced by agent calls to have the right pare…
google-genai-bot Mar 10, 2026
305299f
refactor: remove the Optional param in VertexAiCodeExecutor method
tilgalas Mar 10, 2026
b71900f
refactor: Use Maybe instead of Single<Optional>
google-genai-bot Mar 10, 2026
d1d5539
feat: update return type for artifactDelta getter and setter to Map f…
google-genai-bot Mar 10, 2026
b8316b1
feat!: Remove Optional parameters in EventActions
tilgalas Mar 10, 2026
14ee28b
fix: Make sure that `InvocationContext.callbackContextData` remains t…
google-genai-bot Mar 10, 2026
d66c31d
refactor: Removing unnecessary PluginManager.runX() methods
google-genai-bot Mar 10, 2026
72c9804
refactor: suppress warnings for Optional param in LlmRequest.addInstr…
tilgalas Mar 10, 2026
aa0e06c
refactor: update ApiClient.createHttpClient Optional timeout param to…
tilgalas Mar 10, 2026
444e0f0
refactor: delete SessionJsonConverter.putIfEmpty method with Optional…
tilgalas Mar 10, 2026
b857f01
fix: Removing deprecated methods in Runner
google-genai-bot Mar 10, 2026
0d8e22d
fix: Removing deprecated methods in Runner
google-genai-bot Mar 10, 2026
20f863f
fix: Explicitly setting the otel parent spans in agents, llm flow and…
google-genai-bot Mar 11, 2026
c6fdb63
feat: update State constructors to accept general Map types
google-genai-bot Mar 11, 2026
e0d833b
feat!: update LoopAgent's maxIteration field and methods to be @Nulla…
tilgalas Mar 11, 2026
1a87114
refactor: Simplifying Tracing code
google-genai-bot Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
package com.google.adk.a2a;
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.agent;

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

Expand Down Expand Up @@ -44,26 +59,21 @@
import org.slf4j.LoggerFactory;

/**
* Agent that communicates with a remote A2A agent via A2A client.
*
* <p>This agent supports multiple ways to specify the remote agent:
* Agent that communicates with a remote A2A agent via an A2A client.
*
* <ol>
* <li>Direct AgentCard object
* <li>URL to agent card JSON
* <li>File path to agent card JSON
* </ol>
* <p>The remote agent can be specified directly by providing an {@link AgentCard} to the builder,
* or it can be resolved automatically using the provided A2A client.
*
* <p>The agent handles:
* <p>Key responsibilities of this agent include:
*
* <ul>
* <li>Agent card resolution and validation
* <li>A2A message conversion and error handling
* <li>Session state management across requests
* <li>Converting ADK session history events into A2A requests ({@link io.a2a.spec.Message})
* <li>Handling streaming and non-streaming responses from the A2A client
* <li>Buffering and aggregating streamed response chunks into ADK {@link
* com.google.adk.events.Event}s
* <li>Converting A2A client responses back into ADK format
* </ul>
*
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
* use in production code.
*/
public class RemoteA2AAgent extends BaseAgent {

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

event.setContent(Optional.of(aggregatedContent));
event.setContent(aggregatedContent);

ImmutableList.Builder<CustomMetadata> newMetadata = ImmutableList.builder();
event.customMetadata().ifPresent(newMetadata::addAll);
Expand Down
15 changes: 15 additions & 0 deletions a2a/src/main/java/com/google/adk/a2a/common/A2AClientError.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.common;

/** Exception thrown when the A2A client encounters an error. */
Expand Down
15 changes: 15 additions & 0 deletions a2a/src/main/java/com/google/adk/a2a/common/A2AMetadata.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.common;

/** Constants and utilities for A2A metadata keys. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.common;

/** Exception thrown when the the genai class has an empty field. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.converters;

/** Enum for the type of A2A DataPart metadata. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.converters;

import static com.google.common.collect.ImmutableList.toImmutableList;
Expand All @@ -13,12 +28,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Converter for ADK Events to A2A Messages.
*
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
* use in production code.
*/
/** Converter for ADK Events to A2A Messages. */
public final class EventConverter {
private static final Logger logger = LoggerFactory.getLogger(EventConverter.class);

Expand Down
22 changes: 16 additions & 6 deletions a2a/src/main/java/com/google/adk/a2a/converters/PartConverter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.converters;

import static com.google.common.collect.ImmutableList.toImmutableList;
Expand Down Expand Up @@ -32,12 +47,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Utility class for converting between Google GenAI Parts and A2A DataParts.
*
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
* use in production code.
*/
/** Utility class for converting between Google GenAI Parts and A2A DataParts. */
public final class PartConverter {

private static final Logger logger = LoggerFactory.getLogger(PartConverter.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.converters;

import static com.google.common.collect.ImmutableList.toImmutableList;
Expand Down Expand Up @@ -27,12 +42,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

Event eventPart = artifactToEvent(artifactEvent.getArtifact(), context);
eventPart.setPartial(Optional.of(isAppend || !isLastChunk));
eventPart.setPartial(isAppend || !isLastChunk);
// append=true, lastChunk=false: emit as partial, update aggregation
// append=false, lastChunk=false: emit as partial, reset aggregation
// append=true, lastChunk=true: emit as partial, update aggregation and emit as non-partial
Expand Down
22 changes: 16 additions & 6 deletions a2a/src/main/java/com/google/adk/a2a/executor/AgentExecutor.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.executor;

import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -44,12 +59,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Implementation of the A2A AgentExecutor interface that uses ADK to execute agent tasks.
*
* <p>**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not
* use in production code.
*/
/** Implementation of the A2A AgentExecutor interface that uses ADK to execute agent tasks. */
public class AgentExecutor implements io.a2a.server.agentexecution.AgentExecutor {
private static final Logger logger = LoggerFactory.getLogger(AgentExecutor.class);
private static final String USER_ID_PREFIX = "A2A_USER_";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.executor;

import com.google.adk.a2a.executor.Callbacks.AfterEventCallback;
Expand Down
15 changes: 15 additions & 0 deletions a2a/src/main/java/com/google/adk/a2a/executor/Callbacks.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.adk.a2a.executor;

import com.google.adk.events.Event;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.google.adk.a2a;
package com.google.adk.a2a.agent;

import static com.google.common.truth.Truth.assertThat;
import static java.util.concurrent.TimeUnit.SECONDS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private RequestContext createRequestContext() {
public void process_statefulAggregation_tracksArtifactIdAndAppendForAuthor() {
Event partial1 =
Event.builder()
.partial(Optional.of(true))
.partial(true)
.author("agent_author")
.content(
Content.builder()
Expand All @@ -370,7 +370,7 @@ public void process_statefulAggregation_tracksArtifactIdAndAppendForAuthor() {
.build();
Event partial2 =
Event.builder()
.partial(Optional.of(true))
.partial(true)
.author("agent_author")
.content(
Content.builder()
Expand All @@ -379,7 +379,7 @@ public void process_statefulAggregation_tracksArtifactIdAndAppendForAuthor() {
.build();
Event finalEvent =
Event.builder()
.partial(Optional.of(false))
.partial(false)
.author("agent_author")
.content(
Content.builder()
Expand Down
2 changes: 1 addition & 1 deletion contrib/samples/a2a_basic/A2AAgent.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.a2a_basic;

import com.google.adk.a2a.RemoteA2AAgent;
import com.google.adk.a2a.agent.RemoteA2AAgent;
import com.google.adk.agents.BaseAgent;
import com.google.adk.agents.LlmAgent;
import com.google.adk.tools.FunctionTool;
Expand Down
Loading
Loading