Skip to content

Commit fcdbacb

Browse files
committed
fix: correct AgentCard example in README
Replace non-existent `.url()` and `.protocolVersion()` builder calls with the correct `.supportedInterfaces()` method, and add the missing `AgentInterface` import.
1 parent c595071 commit fcdbacb

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,24 @@ you'd like to support.
104104
import io.a2a.server.PublicAgentCard;
105105
import io.a2a.spec.AgentCapabilities;
106106
import io.a2a.spec.AgentCard;
107+
import io.a2a.spec.AgentInterface;
107108
import io.a2a.spec.AgentSkill;
109+
import io.a2a.spec.TransportProtocol;
108110
...
109111

110112
@ApplicationScoped
111113
public class WeatherAgentCardProducer {
112-
114+
115+
private static final String AGENT_URL = "http://localhost:10001";
116+
113117
@Produces
114118
@PublicAgentCard
115119
public AgentCard agentCard() {
116120
return AgentCard.builder()
117121
.name("Weather Agent")
118122
.description("Helps with weather")
119-
.url("http://localhost:10001")
123+
.supportedInterfaces(List.of(
124+
new AgentInterface(TransportProtocol.JSONRPC.asString(), AGENT_URL)))
120125
.version("1.0.0")
121126
.capabilities(AgentCapabilities.builder()
122127
.streaming(true)
@@ -131,7 +136,6 @@ public class WeatherAgentCardProducer {
131136
.tags(Collections.singletonList("weather"))
132137
.examples(List.of("weather in LA, CA"))
133138
.build()))
134-
.protocolVersion(io.a2a.spec.AgentCard.CURRENT_PROTOCOL_VERSION)
135139
.build();
136140
}
137141
}

0 commit comments

Comments
 (0)