return structured next action for game query plan
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user