chain ADB chat game extraction before vector resolution
This commit is contained in:
@@ -194,7 +194,7 @@ public class McpSseService {
|
||||
response = gameScopeResponse(gameScopeService.resolve(
|
||||
token, arguments.path("question").asText("")));
|
||||
} else if (gameCatalogTool) {
|
||||
response = gameCatalogVectorResponse(gameCatalogVectorService.search(
|
||||
response = gameCatalogVectorResponse(gameCatalogVectorService.resolve(
|
||||
token, arguments.path("question").asText(""), arguments.path("topK").asInt(5)));
|
||||
} else {
|
||||
String prompt = arguments.path("prompt").asText("");
|
||||
@@ -247,11 +247,12 @@ public class McpSseService {
|
||||
return response;
|
||||
}
|
||||
|
||||
private ObjectNode gameCatalogVectorResponse(List<GameCatalogVectorService.GameCandidate> candidates) {
|
||||
private ObjectNode gameCatalogVectorResponse(GameCatalogVectorService.Resolution resolution) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.put("status", candidates.isEmpty() ? "NO_MATCH" : "CANDIDATES");
|
||||
response.put("scopeType", resolution.scopeType());
|
||||
response.put("status", resolution.candidates().isEmpty() ? "NO_MATCH" : "CANDIDATES");
|
||||
ArrayNode items = response.putArray("matchedGames");
|
||||
for (GameCatalogVectorService.GameCandidate c : candidates) {
|
||||
for (GameCatalogVectorService.GameCandidate c : resolution.candidates()) {
|
||||
ObjectNode item = items.addObject();
|
||||
item.put("gameKey", c.gameKey()); item.put("gameId", c.gameId());
|
||||
item.put("gamePrefix", c.gamePrefix()); item.put("gameName", c.gameName());
|
||||
|
||||
Reference in New Issue
Block a user