Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ public void createCategories() {
Long categoryId = tempIdToCategoryId.get(tempCategoryId);
String categoryName = tempIdToCategoryName.get(tempCategoryId);

if (categoryId == null || categoryName == null) {
log.warn(
"[createCategories] category id or category name not exists: temp id = {}, real id = {}, category name = {}",
tempCategoryId,
categoryId,
categoryName);
continue;
}

log.debug("[createCategories] save question category vector");
CategoryVectorDocument categoryVectorDocument = CategoryVectorDocument.of(
categoryId, tempCategory.getCentroidVector(), Map.of("categoryName", categoryName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ private List<PromptGenerateUtil.CategoryNameCreatePromptRequest> convertToReques
.map(category -> {
List<Long> questionIds = category.getQuestionDocumentIds();
List<String> questions = questionVectors.stream()
.filter(questionVector -> questionIds.contains(questionVector.getId()))
.filter(questionVector -> {
List<Long> subList = questionIds.size() > 30 ? questionIds.subList(0, 30) : questionIds;
return subList.contains(questionVector.getId());
})
.map(QuestionVectorDocument::getQuestion)
.toList();
return new PromptGenerateUtil.CategoryNameCreatePromptRequest(category.getId(), questions);
Expand Down
Loading