Skip to content

Commit a31ab29

Browse files
ehsavoieclaude
andcommitted
feat: Add agentCard method to ProtoUtils.FromProto
Added ProtoUtils.FromProto.agentCard() method to convert io.a2a.grpc.AgentCard to io.a2a.spec.AgentCard. - Follows the same pattern as other FromProto methods (handles both concrete and builder types) - Uses AgentCardMapper.INSTANCE.fromProto() for the conversion - Positioned at the start of FromProto class for consistency with ToProto ordering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent fca4705 commit a31ab29

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec-grpc/src/main/java/io/a2a/grpc/utils/ProtoUtils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ public static io.a2a.grpc.StreamResponse taskOrMessageStream(StreamingEventKind
184184

185185
public static class FromProto {
186186

187+
public static AgentCard agentCard(io.a2a.grpc.AgentCardOrBuilder agentCard) {
188+
io.a2a.grpc.AgentCard agentCardProto = agentCard instanceof io.a2a.grpc.AgentCard
189+
? (io.a2a.grpc.AgentCard) agentCard
190+
: ((io.a2a.grpc.AgentCard.Builder) agentCard).build();
191+
return AgentCardMapper.INSTANCE.fromProto(agentCardProto);
192+
}
193+
187194
public static TaskQueryParams taskQueryParams(io.a2a.grpc.GetTaskRequestOrBuilder request) {
188195
io.a2a.grpc.GetTaskRequest reqProto = request instanceof io.a2a.grpc.GetTaskRequest
189196
? (io.a2a.grpc.GetTaskRequest) request

0 commit comments

Comments
 (0)