Annotation Interface A2AClientCustomizer


@Retention(RUNTIME) @Target(METHOD) public @interface A2AClientCustomizer
Marks a static method that customizes the underlying A2A SDK ClientBuilder before the Client is constructed.

The annotated method must be static, take a single parameter of type org.a2aproject.sdk.client.ClientBuilder, and return void. It is invoked once at build time, allowing transport, interceptors, streaming, and other low-level configuration to be specified declaratively.

Example:

public interface MyA2AAgent {

    @A2AClientAgent(a2aServerUrl = "http://localhost:8080", outputKey = "result")
    String invoke(@V("input") String input);

    @A2AClientCustomizer
    static void customizer(ClientBuilder cb) {
        cb.withTransport(JSONRPCTransport.class,
            new JSONRPCTransportConfigBuilder()
                .addInterceptor(new MyOtelInterceptor()));
    }
}