File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,19 @@ export class A2AClient {
347347 return this . _postRpcRequest < TaskIdParams , CancelTaskResponse > ( "tasks/cancel" , params ) ;
348348 }
349349
350+ /**
351+ * @template TExtensionParams The type of parameters for the custom extension method.
352+ * @template TExtensionResponse The type of response expected from the custom extension method.
353+ * This should extend JSONRPCResponse. This ensures the extension response is still a valid A2A response.
354+ * @param method Custom JSON-RPC method defined in the AgentCard's extensions.
355+ * @param params Extension paramters defined in the AgentCard's extensions.
356+ * @returns A Promise that resolves to the RPC response.
357+ */
358+ public async callExtensionMethod < TExtensionParams , TExtensionResponse extends JSONRPCResponse > ( method : string , params : TExtensionParams ) {
359+ return this . _postRpcRequest < TExtensionParams , TExtensionResponse > ( method , params ) ;
360+ }
361+
362+
350363 /**
351364 * Resubscribes to a task's event stream using Server-Sent Events (SSE).
352365 * This is used if a previous SSE connection for an active task was broken.
You can’t perform that action at this time.
0 commit comments