mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(fix)(headless)Updating dimension should update modelDetail as well.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user