@@ -23,7 +23,7 @@ type A2AClient interface {
23
23
24
24
// Task operations
25
25
SendTask (ctx context.Context , params types.MessageSendParams ) (* types.JSONRPCSuccessResponse , error )
26
- SendTaskStreaming (ctx context.Context , params types.MessageSendParams , eventChan chan <- interface {} ) error
26
+ SendTaskStreaming (ctx context.Context , params types.MessageSendParams , eventChan chan <- any ) error
27
27
GetTask (ctx context.Context , params types.TaskQueryParams ) (* types.JSONRPCSuccessResponse , error )
28
28
ListTasks (ctx context.Context , params types.TaskListParams ) (* types.JSONRPCSuccessResponse , error )
29
29
CancelTask (ctx context.Context , params types.TaskIdParams ) (* types.JSONRPCSuccessResponse , error )
@@ -128,7 +128,7 @@ func (c *Client) SendTask(ctx context.Context, params types.MessageSendParams) (
128
128
req := types.JSONRPCRequest {
129
129
JSONRPC : "2.0" ,
130
130
Method : "message/send" ,
131
- Params : make (map [string ]interface {} ),
131
+ Params : make (map [string ]any ),
132
132
}
133
133
134
134
paramsBytes , err := json .Marshal (params )
@@ -137,7 +137,7 @@ func (c *Client) SendTask(ctx context.Context, params types.MessageSendParams) (
137
137
return nil , fmt .Errorf ("failed to marshal params: %w" , err )
138
138
}
139
139
140
- var paramsMap map [string ]interface {}
140
+ var paramsMap map [string ]any
141
141
if err := json .Unmarshal (paramsBytes , & paramsMap ); err != nil {
142
142
c .logger .Error ("failed to unmarshal params to map" , zap .Error (err ))
143
143
return nil , fmt .Errorf ("failed to unmarshal params to map: %w" , err )
@@ -155,7 +155,7 @@ func (c *Client) SendTask(ctx context.Context, params types.MessageSendParams) (
155
155
}
156
156
157
157
// SendTaskStreaming sends a task and streams the response (primary interface following official A2A pattern)
158
- func (c * Client ) SendTaskStreaming (ctx context.Context , params types.MessageSendParams , eventChan chan <- interface {} ) error {
158
+ func (c * Client ) SendTaskStreaming (ctx context.Context , params types.MessageSendParams , eventChan chan <- any ) error {
159
159
c .logger .Debug ("starting task streaming" ,
160
160
zap .String ("method" , "message/stream" ),
161
161
zap .String ("message_id" , params .Message .MessageID ),
@@ -164,7 +164,7 @@ func (c *Client) SendTaskStreaming(ctx context.Context, params types.MessageSend
164
164
req := types.JSONRPCRequest {
165
165
JSONRPC : "2.0" ,
166
166
Method : "message/stream" ,
167
- Params : make (map [string ]interface {} ),
167
+ Params : make (map [string ]any ),
168
168
}
169
169
170
170
paramsBytes , err := json .Marshal (params )
@@ -173,7 +173,7 @@ func (c *Client) SendTaskStreaming(ctx context.Context, params types.MessageSend
173
173
return fmt .Errorf ("failed to marshal params: %w" , err )
174
174
}
175
175
176
- var paramsMap map [string ]interface {}
176
+ var paramsMap map [string ]any
177
177
if err := json .Unmarshal (paramsBytes , & paramsMap ); err != nil {
178
178
c .logger .Error ("failed to unmarshal params to map" , zap .Error (err ))
179
179
return fmt .Errorf ("failed to unmarshal params to map: %w" , err )
@@ -272,7 +272,7 @@ func (c *Client) GetTask(ctx context.Context, params types.TaskQueryParams) (*ty
272
272
req := types.JSONRPCRequest {
273
273
JSONRPC : "2.0" ,
274
274
Method : "tasks/get" ,
275
- Params : make (map [string ]interface {} ),
275
+ Params : make (map [string ]any ),
276
276
}
277
277
278
278
paramsBytes , err := json .Marshal (params )
@@ -281,7 +281,7 @@ func (c *Client) GetTask(ctx context.Context, params types.TaskQueryParams) (*ty
281
281
return nil , fmt .Errorf ("failed to marshal params: %w" , err )
282
282
}
283
283
284
- var paramsMap map [string ]interface {}
284
+ var paramsMap map [string ]any
285
285
if err := json .Unmarshal (paramsBytes , & paramsMap ); err != nil {
286
286
c .logger .Error ("failed to unmarshal params to map" , zap .Error (err ))
287
287
return nil , fmt .Errorf ("failed to unmarshal params to map: %w" , err )
@@ -305,7 +305,7 @@ func (c *Client) CancelTask(ctx context.Context, params types.TaskIdParams) (*ty
305
305
req := types.JSONRPCRequest {
306
306
JSONRPC : "2.0" ,
307
307
Method : "tasks/cancel" ,
308
- Params : make (map [string ]interface {} ),
308
+ Params : make (map [string ]any ),
309
309
}
310
310
311
311
paramsBytes , err := json .Marshal (params )
@@ -314,7 +314,7 @@ func (c *Client) CancelTask(ctx context.Context, params types.TaskIdParams) (*ty
314
314
return nil , fmt .Errorf ("failed to marshal params: %w" , err )
315
315
}
316
316
317
- var paramsMap map [string ]interface {}
317
+ var paramsMap map [string ]any
318
318
if err := json .Unmarshal (paramsBytes , & paramsMap ); err != nil {
319
319
c .logger .Error ("failed to unmarshal params to map" , zap .Error (err ))
320
320
return nil , fmt .Errorf ("failed to unmarshal params to map: %w" , err )
@@ -338,7 +338,7 @@ func (c *Client) ListTasks(ctx context.Context, params types.TaskListParams) (*t
338
338
req := types.JSONRPCRequest {
339
339
JSONRPC : "2.0" ,
340
340
Method : "tasks/list" ,
341
- Params : make (map [string ]interface {} ),
341
+ Params : make (map [string ]any ),
342
342
}
343
343
344
344
paramsBytes , err := json .Marshal (params )
@@ -347,7 +347,7 @@ func (c *Client) ListTasks(ctx context.Context, params types.TaskListParams) (*t
347
347
return nil , fmt .Errorf ("failed to marshal params: %w" , err )
348
348
}
349
349
350
- var paramsMap map [string ]interface {}
350
+ var paramsMap map [string ]any
351
351
if err := json .Unmarshal (paramsBytes , & paramsMap ); err != nil {
352
352
c .logger .Error ("failed to unmarshal params to map" , zap .Error (err ))
353
353
return nil , fmt .Errorf ("failed to unmarshal params to map: %w" , err )
@@ -553,7 +553,7 @@ func (c *Client) doRequestWithContext(ctx context.Context, req types.JSONRPCRequ
553
553
554
554
var rawResp struct {
555
555
JSONRPC string `json:"jsonrpc"`
556
- ID interface {} `json:"id,omitempty"`
556
+ ID any `json:"id,omitempty"`
557
557
Result json.RawMessage `json:"result,omitempty"`
558
558
Error * types.JSONRPCError `json:"error,omitempty"`
559
559
}
0 commit comments