From 956693bb23cc441670e19a1bf4b4da4289449afe Mon Sep 17 00:00:00 2001 From: devmrko Date: Mon, 27 Jul 2026 14:49:30 +0900 Subject: [PATCH] return structured next action for game query plan --- .../vpdbackoffice/service/McpSseService.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/cloudhandson/vpdbackoffice/service/McpSseService.java b/src/main/java/com/cloudhandson/vpdbackoffice/service/McpSseService.java index b32576d..4199e6c 100644 --- a/src/main/java/com/cloudhandson/vpdbackoffice/service/McpSseService.java +++ b/src/main/java/com/cloudhandson/vpdbackoffice/service/McpSseService.java @@ -382,6 +382,20 @@ public class McpSseService { private ObjectNode gameQueryPlanResponse(GameCatalogVectorService.Resolution resolution) { ObjectNode response = gameCatalogVectorResponse(resolution); response.put("status", resolution.candidates().isEmpty() ? "NO_MATCH" : "SUPPORTED"); + ArrayNode supported = response.putArray("supportedGames"); + for (GameCatalogVectorService.GameCandidate c : resolution.candidates()) { + ObjectNode item = supported.addObject(); + item.put("gameKey", c.gameKey()); + item.put("gameId", c.gameId()); + item.put("gameName", c.gameName()); + item.put("gamePrefix", c.gamePrefix()); + item.put("cosineDistance", c.similarity()); + } + response.putArray("unmatchedGames"); + response.put("nextAction", resolution.candidates().isEmpty() + ? "STOP_NO_MATCH" + : ("MULTI_GAME".equals(resolution.scopeType()) + ? "CALL_FEWSHOT_PER_GAME" : "CALL_FEWSHOT")); String mode = switch (resolution.scopeType()) { case "SINGLE_GAME" -> "SINGLE"; case "MULTI_GAME" -> "FAN_OUT";