@@ -20,10 +20,12 @@ public class AgentCardProducer {
2020 @ Produces
2121 @ PublicAgentCard
2222 public AgentCard agentCard () {
23+ String SUT_JSONRPC_URL = getEnvOrDefault ("SUT_JSONRPC_URL" , "http://localhost:9999" );
24+ String SUT_GRPC_URL = getEnvOrDefault ("SUT_GRPC_URL" , "http://localhost:9000" );
2325 return new AgentCard .Builder ()
2426 .name ("Hello World Agent" )
2527 .description ("Just a hello world agent" )
26- .url ("http://localhost:9999" )
28+ .url (SUT_JSONRPC_URL )
2729 .version ("1.0.0" )
2830 .documentationUrl ("http://example.com/docs" )
2931 .capabilities (new AgentCapabilities .Builder ()
@@ -42,9 +44,14 @@ public AgentCard agentCard() {
4244 .build ()))
4345 .protocolVersion ("0.3.0" )
4446 .additionalInterfaces (List .of (
45- new AgentInterface (TransportProtocol .JSONRPC .asString (), "http://localhost:9999" ),
46- new AgentInterface (TransportProtocol .GRPC .asString (), "http://localhost:9000" )))
47+ new AgentInterface (TransportProtocol .JSONRPC .asString (), SUT_JSONRPC_URL ),
48+ new AgentInterface (TransportProtocol .GRPC .asString (), SUT_GRPC_URL )))
4749 .build ();
4850 }
51+
52+ private static String getEnvOrDefault (String envVar , String defaultValue ) {
53+ String value = System .getenv (envVar );
54+ return value == null || value .isEmpty () ? defaultValue : value ;
55+ }
4956}
5057
0 commit comments