Skip to content

Commit c732060

Browse files
authored
fix: regenerate proto and update converters (#81)
A lot of json-proto discrepancies were addressed in the spec repo since we generated types from `.proto`: * Missing `Message.ReferenceTaskIDs`. * Missing `Part.Metadata`. * Missing fields on `AgentCard`: `IconUrl`, `Signatures`. * `AgentCapabilities.Security` and `AgentCapabilities.StateTransitionHistory`. This PR updates the spec and fixes converters. Discrepancies were blocking the work which required Parts to have metadata.
1 parent 192730b commit c732060

File tree

9 files changed

+1163
-428
lines changed

9 files changed

+1163
-428
lines changed

a2a/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ type AgentSkill struct {
212212
// As in the overall AgentCard.security, this list represents a logical OR of
213213
// security requirement objects.
214214
// Each object is a set of security schemes that must be used together (a logical AND).
215-
Security []map[string][]string `json:"security,omitempty" yaml:"security,omitempty" mapstructure:"security,omitempty"`
215+
Security []SecurityRequirements `json:"security,omitempty" yaml:"security,omitempty" mapstructure:"security,omitempty"`
216216

217217
// Tags is a set of keywords describing the skill's capabilities.
218218
Tags []string `json:"tags" yaml:"tags" mapstructure:"tags"`

a2agrpc/handler_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ func TestGrpcHandler_SendMessage(t *testing.T) {
457457
MessageId: "req-msg-123",
458458
TaskId: "test-task-123",
459459
Role: a2apb.Role_ROLE_USER,
460-
Content: []*a2apb.Part{
460+
Parts: []*a2apb.Part{
461461
{
462462
Part: &a2apb.Part_Text{Text: "Hello Agent"},
463463
},
@@ -470,7 +470,7 @@ func TestGrpcHandler_SendMessage(t *testing.T) {
470470
MessageId: "req-msg-123-response",
471471
TaskId: "test-task-123",
472472
Role: a2apb.Role_ROLE_AGENT,
473-
Content: []*a2apb.Part{
473+
Parts: []*a2apb.Part{
474474
{
475475
Part: &a2apb.Part_Text{Text: "Hello Agent"},
476476
},
@@ -496,7 +496,7 @@ func TestGrpcHandler_SendMessage(t *testing.T) {
496496
name: "invalid request",
497497
req: &a2apb.SendMessageRequest{
498498
Request: &a2apb.Message{
499-
Content: []*a2apb.Part{{Part: nil}},
499+
Parts: []*a2apb.Part{{Part: nil}},
500500
},
501501
},
502502
wantErr: codes.InvalidArgument,
@@ -566,7 +566,7 @@ func TestGrpcHandler_SendStreamingMessage(t *testing.T) {
566566
MessageId: msgID,
567567
TaskId: string(taskID),
568568
ContextId: contextID,
569-
Content: parts,
569+
Parts: parts,
570570
Role: a2apb.Role_ROLE_USER,
571571
},
572572
},
@@ -595,7 +595,7 @@ func TestGrpcHandler_SendStreamingMessage(t *testing.T) {
595595
MessageId: fmt.Sprintf("%s-response", msgID),
596596
TaskId: string(taskID),
597597
Role: a2apb.Role_ROLE_AGENT,
598-
Content: parts,
598+
Parts: parts,
599599
},
600600
},
601601
},
@@ -619,7 +619,7 @@ func TestGrpcHandler_SendStreamingMessage(t *testing.T) {
619619
name: "invalid request",
620620
req: &a2apb.SendMessageRequest{
621621
Request: &a2apb.Message{
622-
Content: []*a2apb.Part{{Part: nil}},
622+
Parts: []*a2apb.Part{{Part: nil}},
623623
},
624624
},
625625
wantErr: codes.InvalidArgument,

0 commit comments

Comments
 (0)