allow plan context when optional scope view unavailable
This commit is contained in:
@@ -99,6 +99,10 @@ public class GameScopeService {
|
|||||||
return new GameScopeResult(normalizedQuestion, status, scopes);
|
return new GameScopeResult(normalizedQuestion, status, scopes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean configured() {
|
||||||
|
return gameScopeProperties != null && gameScopeProperties.configured();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true when a generated SQL references a DB-declared game-prefix
|
* Returns true when a generated SQL references a DB-declared game-prefix
|
||||||
* object. Prefixes are read from the configured scope view; no game or table
|
* object. Prefixes are read from the configured scope view; no game or table
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ public class SelectAiService {
|
|||||||
if (requestedKey.isEmpty()) {
|
if (requestedKey.isEmpty()) {
|
||||||
return new ResolvedExecutionScope(originalPrompt, null, null);
|
return new ResolvedExecutionScope(originalPrompt, null, null);
|
||||||
}
|
}
|
||||||
if (gameScopeService == null) {
|
if (gameScopeService == null || !gameScopeService.configured()) {
|
||||||
throw new AppException("게임 범위 검증 서비스를 사용할 수 없습니다.");
|
return new ResolvedExecutionScope(originalPrompt, requestedKey, null);
|
||||||
}
|
}
|
||||||
GameScopeService.GameScope scope = gameScopeService.resolve(bearerToken, originalPrompt).scopes().stream()
|
GameScopeService.GameScope scope = gameScopeService.resolve(bearerToken, originalPrompt).scopes().stream()
|
||||||
.filter(item -> requestedKey.equals(item.gameKey()))
|
.filter(item -> requestedKey.equals(item.gameKey()))
|
||||||
|
|||||||
Reference in New Issue
Block a user