mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-09-22 12:35:11 +08:00
embedding sql
This commit is contained in:
@ -157,10 +157,6 @@ public class EmbeddingController extends ChatController {
|
||||
if (StringUtils.isBlank(vectorParam.getDatabase()) && StringUtils.isBlank(vectorParam.getSchema())) {
|
||||
return;
|
||||
}
|
||||
DataResult<Boolean> result = tableService.checkTableVector(vectorParam);
|
||||
if (result.getData()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ConfigService configService = ApplicationContextUtil.getBean(ConfigService.class);
|
||||
Config config = configService.find(RestAIClient.AI_SQL_SOURCE).getData();
|
||||
@ -178,6 +174,12 @@ public class EmbeddingController extends ChatController {
|
||||
String apiKey = keyConfig.getContent();
|
||||
request.setApikey(apiKey);
|
||||
|
||||
vectorParam.setApiKey(apiKey);
|
||||
DataResult<Boolean> result = tableService.checkTableVector(vectorParam);
|
||||
if (result.getData()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check if in white list
|
||||
boolean res = gatewayClientService.checkInWhite(new WhiteListRequest(apiKey, WhiteListTypeEnum.VECTOR.getCode())).getData();
|
||||
if (!res) {
|
||||
|
Reference in New Issue
Block a user