Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public final class ServerSampleAgentCardBuilder {
static final String NOTIFICATION_T_EXTENSION_URI =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/v1";

static final String NOTIFICATION_T_EXTENSION_URI_NL =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/NL/v1";

private ServerSampleAgentCardBuilder() {}

/**
Expand Down Expand Up @@ -51,12 +48,7 @@ public static Map<String, Object> buildAgentCard(String host, int port) {
"uri",
NOTIFICATION_T_EXTENSION_URI,
"description",
"Extension of structured prompt Notification-T requests."),
Map.of(
"uri",
NOTIFICATION_T_EXTENSION_URI_NL,
"description",
"Legacy alias of the Notification-T extension."))),
"Extension of structured prompt Notification-T requests."))),
"supportedInterfaces",
List.of(Map.of(
"protocolBinding", "HTTP+JSON",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
* @since 2026-08
*/
public final class ServerSampleFlow {
static final String NOTIFICATION_T_EXTENSION_URI_NL =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/NL/v1";

static final String NOTIFICATION_T_EXTENSION_URI =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/v1";

Expand Down Expand Up @@ -147,8 +144,7 @@ private static void requireNotificationExtension(ServerCallContext callContext)
String modernValue = headers.get("A2A-Extensions");
String legacyValue = headers.get("X-A2A-Extensions");
String extensionValue = modernValue != null ? modernValue : legacyValue;
if (!NOTIFICATION_T_EXTENSION_URI_NL.equals(extensionValue)
&& !NOTIFICATION_T_EXTENSION_URI.equals(extensionValue)) {
if (!NOTIFICATION_T_EXTENSION_URI.equals(extensionValue)) {
throw new ValueErrorException("a2a client extensions is not exist.");
}
}
Expand All @@ -158,11 +154,7 @@ private static String extractPromptText(RequestContext requestContext) {
if (message == null || message.metadata() == null) {
throw new ValueErrorException("Expected message metadata for Notification-T prompt");
}
String promptText = stringValue(message.metadata().get(NOTIFICATION_T_EXTENSION_URI_NL));
if (promptText.isEmpty()) {
promptText = stringValue(message.metadata().get(NOTIFICATION_T_EXTENSION_URI));
}
return promptText;
return stringValue(message.metadata().get(NOTIFICATION_T_EXTENSION_URI));
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* @since 2026-05
*/
public final class ClientSampleFlow {
static final String NOTIFICATION_T_EXTENSION_URI_NL =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/NL/v1";
static final String NOTIFICATION_T_EXTENSION_URI =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/v1";

static final String NATURAL_LANGUAGE_PROMPT_INPUT_ZH =
"请生成一个Incident事件订阅任务:通知主题为Incident,订阅条件为订阅级别为critical的ETH-LOS的故障,上报通知数据格式为DataPart";
Expand Down Expand Up @@ -99,7 +99,7 @@ public static List<Map<String, Object>> runClientFlow(
String promptText = requirePromptText(promptResult);

BuiltA2AJavaRequest builtRequest = A2AJavaRequestBuilder.buildStreamRequest(
promptText, NOTIFICATION_T_EXTENSION_URI_NL, buildRequestMetadata(scenarioPayload));
promptText, NOTIFICATION_T_EXTENSION_URI, buildRequestMetadata(scenarioPayload));
emit(logSink, SampleLoggingFormatter.formatPayloadLog("client", "a2a-request-body", builtRequest.request()));
emit(
logSink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public final class ServerSampleAgentCardBuilder {
static final String TASK_T_EXTENSION_URI_NL =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Task-T/NL/v1";

static final String NOTIFICATION_T_EXTENSION_URI_NL =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/NL/v1";
static final String NOTIFICATION_T_EXTENSION_URI =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/v1";

private ServerSampleAgentCardBuilder() {}

Expand Down Expand Up @@ -47,7 +47,7 @@ public static Map<String, Object> buildAgentCard(String host, int port) {
"Extension of structured prompt Task-T requests."),
Map.of(
"uri",
NOTIFICATION_T_EXTENSION_URI_NL,
NOTIFICATION_T_EXTENSION_URI,
"description",
"Extension of structured prompt Notification-T requests."))),
"supportedInterfaces",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
* @since 2026-05
*/
public final class ServerSampleFlow {
static final String NOTIFICATION_T_EXTENSION_URI_NL =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/NL/v1";

static final String NOTIFICATION_T_EXTENSION_URI =
"https://projects.tmforum.org/a2aproject/telecommunication/extensions/Notification-T/v1";

Expand Down Expand Up @@ -110,8 +107,7 @@ private static void requireNotificationExtension(ServerCallContext callContext)
String modernValue = headers.get("A2A-Extensions");
String legacyValue = headers.get("X-A2A-Extensions");
String extensionValue = modernValue != null ? modernValue : legacyValue;
if (!NOTIFICATION_T_EXTENSION_URI_NL.equals(extensionValue)
&& !NOTIFICATION_T_EXTENSION_URI.equals(extensionValue)) {
if (!NOTIFICATION_T_EXTENSION_URI.equals(extensionValue)) {
throw new ValueErrorException("a2a client extensions is not exist.");
}
}
Expand All @@ -121,11 +117,7 @@ private static String extractPromptText(RequestContext requestContext) {
if (message == null || message.metadata() == null) {
throw new ValueErrorException("Expected message metadata for Notification-T prompt");
}
String promptText = stringValue(message.metadata().get(NOTIFICATION_T_EXTENSION_URI_NL));
if (promptText.isEmpty()) {
promptText = stringValue(message.metadata().get(NOTIFICATION_T_EXTENSION_URI));
}
return promptText;
return stringValue(message.metadata().get(NOTIFICATION_T_EXTENSION_URI));
}

@SuppressWarnings("unchecked")
Expand Down
Loading