mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
[feature][headless-chat]Introduce ChatApp to support more flexible chat model config.#1739
This commit is contained in:
@@ -55,11 +55,14 @@ public class MemoryReviewTask {
|
||||
|
||||
@Scheduled(fixedDelay = 60 * 1000)
|
||||
public void review() {
|
||||
try {
|
||||
memoryService.getMemoriesForLlmReview().stream().forEach(this::processMemory);
|
||||
} catch (Exception e) {
|
||||
log.error("Exception occurred during memory review task", e);
|
||||
}
|
||||
memoryService.getMemoriesForLlmReview().stream().forEach(memory -> {
|
||||
try {
|
||||
processMemory(memory);
|
||||
} catch (Exception e) {
|
||||
log.error("Exception occurred while processing memory with id {}: {}",
|
||||
memory.getId(), e.getMessage(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void processMemory(ChatMemoryDO m) {
|
||||
|
||||
@@ -16,9 +16,7 @@ import com.tencent.supersonic.chat.server.service.ChatModelService;
|
||||
import com.tencent.supersonic.chat.server.service.ChatQueryService;
|
||||
import com.tencent.supersonic.chat.server.service.MemoryService;
|
||||
import com.tencent.supersonic.common.pojo.ChatApp;
|
||||
import com.tencent.supersonic.common.pojo.ChatModelConfig;
|
||||
import com.tencent.supersonic.common.util.JsonUtil;
|
||||
import com.tencent.supersonic.headless.chat.parser.llm.OnePassSCSqlGenStrategy;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
Reference in New Issue
Block a user