[feature][headless-chat]Introduce ChatApp to support more flexible chat model config.#1739

This commit is contained in:
jerryjzhang
2024-10-12 11:58:34 +08:00
9 changed files with 93 additions and 27 deletions

View File

@@ -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) {

View File

@@ -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;