Skip to content

Commit

Permalink
remove es
Browse files Browse the repository at this point in the history
  • Loading branch information
robinji0 committed Oct 28, 2023
1 parent 6bd0977 commit 3f357b9
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 396,390 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@
</dependency>


<dependency>
<groupId>org.ansj</groupId>
<artifactId>ansj_seg</artifactId>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import ai.chat2db.server.web.api.http.response.EsTableSchemaResponse;
import ai.chat2db.server.web.api.http.response.TableSchemaResponse;
import ai.chat2db.server.web.api.util.ApplicationContextUtil;
import ai.chat2db.server.web.api.util.SegmentUtils;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
Expand Down Expand Up @@ -556,10 +555,9 @@ public String mappingDatabaseSchema(ChatQueryRequest queryRequest) {
if (StringUtils.isNotBlank(apiKey)) {
boolean res = gatewayClientService.checkInWhite(new WhiteListRequest(apiKey, WhiteListTypeEnum.VECTOR.getCode())).getData();
if (res) {
properties = queryDatabaseSchema(queryRequest) + querySchemaByEs(queryRequest);
// properties = queryDatabaseSchema(queryRequest) + querySchemaByEs(queryRequest);
properties = queryDatabaseSchema(queryRequest);
}
} else {
properties = querySchemaByEs(queryRequest);
}
return properties;
}
Expand All @@ -573,10 +571,11 @@ public String mappingDatabaseSchema(ChatQueryRequest queryRequest) {
*/
public String queryDatabaseSchema(ChatQueryRequest queryRequest) {
// request embedding
String input = SegmentUtils.baseAnalysis(queryRequest.getMessage());
log.info("search message:{}", input);
FastChatEmbeddingResponse response = distributeAIEmbedding(input);
FastChatEmbeddingResponse response = distributeAIEmbedding(queryRequest.getMessage());
List<List<BigDecimal>> contentVector = new ArrayList<>();
if (Objects.isNull(response) || CollectionUtils.isEmpty(response.getData())) {
return "";
}
contentVector.add(response.getData().get(0).getEmbedding());

// search embedding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public WebPageResult<TableVO> list(@Valid TableBriefQueryRequest request) {
try {
Chat2DBContext.putContext(connectInfo);
syncTableVector(request);
syncTableEs(request);
// syncTableEs(request);
} catch (Exception e) {
log.error("sync table vector error", e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public WebPageResult<TableVO> list(@Valid TableBriefQueryRequest request) {
try {
Chat2DBContext.putContext(connectInfo);
syncTableVector(request);
syncTableEs(request);
// syncTableEs(request);
} catch (Exception e) {
log.error("sync table vector error", e);
} finally {
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions chat2db-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,6 @@
<version>2.0.24</version>
</dependency>


<dependency>
<groupId>org.ansj</groupId>
<artifactId>ansj_seg</artifactId>
<version>5.1.1</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
11 changes: 0 additions & 11 deletions library/ambiguity.dic

This file was deleted.

Loading

0 comments on commit 3f357b9

Please sign in to comment.