Skip to content

Commit 0cb88e3

Browse files
authored
fix: Update the examples after the latest client changes (#244)
# Description Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Follow the [`CONTRIBUTING` Guide](../CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [x] Ensure the tests pass - [x] Appropriate READMEs were updated (if necessary)
1 parent 5686c8e commit 0cb88e3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

examples/helloworld/client/src/main/java/io/a2a/examples/helloworld/HelloWorldClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import io.a2a.client.ClientEvent;
1717
import io.a2a.client.MessageEvent;
1818
import io.a2a.client.http.A2ACardResolver;
19+
import io.a2a.client.transport.jsonrpc.JSONRPCTransport;
20+
import io.a2a.client.transport.jsonrpc.JSONRPCTransportConfig;
1921
import io.a2a.spec.AgentCard;
2022
import io.a2a.spec.Message;
2123
import io.a2a.spec.Part;
@@ -84,7 +86,9 @@ public static void main(String[] args) {
8486
Client client = Client
8587
.builder(finalAgentCard)
8688
.addConsumers(consumers)
87-
.streamingErrorHandler(streamingErrorHandler).build();
89+
.streamingErrorHandler(streamingErrorHandler)
90+
.withTransport(JSONRPCTransport.class, new JSONRPCTransportConfig())
91+
.build();
8892

8993
Message message = A2A.toUserMessage(MESSAGE_TEXT); // the message ID will be automatically generated for you
9094

examples/helloworld/server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</dependency>
2323
<dependency>
2424
<groupId>io.github.a2asdk</groupId>
25-
<artifactId>a2a-java-sdk-server-common</artifactId>
25+
<artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>
2626
<version>${project.version}</version>
2727
</dependency>
2828
<dependency>

examples/helloworld/server/src/main/java/io/a2a/examples/helloworld/AgentCardProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public AgentCard agentCard() {
3737
.tags(Collections.singletonList("hello world"))
3838
.examples(List.of("hi", "hello world"))
3939
.build()))
40-
.protocolVersion("0.2.5")
40+
.protocolVersion("0.3.0")
4141
.build();
4242
}
4343
}

0 commit comments

Comments
 (0)