Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yinjiaqi authored and yinjiaqi committed Jan 20, 2025
1 parent 73ef777 commit 2619d37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,9 @@ public ChunksDescribeResponse describeChunks(String documentId, String marker, I

public QueryKnowledgeBaseResponse queryKnowledgeBase(QueryKnowledgeBaseRequest request)
throws IOException, AppBuilderServerException {
if (request.rank_score_threshold == null) {
request.rank_score_threshold = 0.4f;
}
String url = AppBuilderConfig.QUERY_KNOWLEDGEBASE_URL;

String jsonBody = JsonUtils.serialize(request);
Expand All @@ -734,10 +737,14 @@ public QueryKnowledgeBaseResponse queryKnowledgeBase(QueryKnowledgeBaseRequest r
return respBody;
}

public QueryKnowledgeBaseResponse queryKnowledgeBase(String query, String type, float rank_score_threshold, Integer top, Integer skip,
public QueryKnowledgeBaseResponse queryKnowledgeBase(String query, String type, Float rank_score_threshold, Integer top, Integer skip,
String[] knowledgebaseIDs, QueryKnowledgeBaseRequest.MetadataFilters filters,
QueryKnowledgeBaseRequest.QueryPipelineConfig pipelineConfig)
throws IOException, AppBuilderServerException {
if (rank_score_threshold == null) {
rank_score_threshold = 0.4f;
}

String url = AppBuilderConfig.QUERY_KNOWLEDGEBASE_URL;
QueryKnowledgeBaseRequest request = new QueryKnowledgeBaseRequest(query, type, rank_score_threshold,top, skip, knowledgebaseIDs, filters, pipelineConfig);
String jsonBody = JsonUtils.serialize(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class QueryKnowledgeBaseRequest {
private String query;
private String type;
private float rank_score_threshold = 0.4f;
private Float rank_score_threshold;
private Integer top;
private Integer skip;
private String[] knowledgebase_ids;
Expand Down

0 comments on commit 2619d37

Please sign in to comment.