mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-25 12:53:43 +08:00
add ai delete
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user