(fix)(headless)Updating dimension should update modelDetail as well.
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled

This commit is contained in:
jerryjzhang
2025-03-19 10:05:04 +08:00
parent 1c85bcecc5
commit 35b835172b
8 changed files with 62 additions and 52 deletions

View File

@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
@Service
@Slf4j
public class MemoryServiceImpl implements MemoryService , CommandLineRunner {
public class MemoryServiceImpl implements MemoryService, CommandLineRunner {
@Autowired
private ChatMemoryRepository chatMemoryRepository;
@@ -195,12 +195,14 @@ public class MemoryServiceImpl implements MemoryService , CommandLineRunner {
public void run(String... args) { // 优化,启动时检查,向量数据,将记忆放到向量数据库
loadSysExemplars();
}
public void loadSysExemplars() {
try {
List<ChatMemory> memories =
this.getMemories(ChatMemoryFilter.builder().status(MemoryStatus.ENABLED).build());
for(ChatMemory memory:memories){
exemplarService.storeExemplar(embeddingConfig.getMemoryCollectionName(memory.getAgentId()),
List<ChatMemory> memories = this
.getMemories(ChatMemoryFilter.builder().status(MemoryStatus.ENABLED).build());
for (ChatMemory memory : memories) {
exemplarService.storeExemplar(
embeddingConfig.getMemoryCollectionName(memory.getAgentId()),
Text2SQLExemplar.builder().question(memory.getQuestion())
.sideInfo(memory.getSideInfo()).dbSchema(memory.getDbSchema())
.sql(memory.getS2sql()).build());