add ai delete

This commit is contained in:
Chuck1sn
2025-05-29 17:09:29 +08:00
parent 55884bb1a1
commit 10bee7c656
14 changed files with 355 additions and 17 deletions

View File

@@ -35,7 +35,7 @@ public class EmbeddingService {
EmbeddingSearchRequest embeddingSearchRequest =
EmbeddingSearchRequest.builder()
.queryEmbedding(zhipuEmbeddingModel.embed(message).content())
.minScore(0.89)
.minScore(0.89)
.build();
EmbeddingSearchResult<TextSegment> embeddingSearchResult =
zhiPuEmbeddingStore.search(embeddingSearchRequest);

View File

@@ -1,5 +1,7 @@
package com.zl.mjga.service;
import static org.jooq.generated.mjga.Tables.AI_LLM_CONFIG;
import com.zl.mjga.dto.PageRequestDto;
import com.zl.mjga.dto.PageResponseDto;
import com.zl.mjga.dto.ai.LlmQueryDto;
@@ -18,8 +20,6 @@ import org.jooq.generated.mjga.tables.pojos.AiLlmConfig;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import static org.jooq.generated.mjga.Tables.AI_LLM_CONFIG;
@Service
@RequiredArgsConstructor
@Slf4j
@@ -44,11 +44,13 @@ public class LlmService {
if (records.isEmpty()) {
return PageResponseDto.empty();
}
List<LlmVm> llmVms = records.map((record) -> {
LlmVm into = record.into(LlmVm.class);
into.setType(record.get(AI_LLM_CONFIG.TYPE).getLiteral());
return into;
});
List<LlmVm> llmVms =
records.map(
(record) -> {
LlmVm into = record.into(LlmVm.class);
into.setType(record.get(AI_LLM_CONFIG.TYPE).getLiteral());
return into;
});
Long totalLlm = records.get(0).getValue("total_llm", Long.class);
return new PageResponseDto<>(totalLlm, llmVms);
}