fix(config): 调整角色缓存TTL为5分钟并更新AI提示语

This commit is contained in:
2026-02-27 13:49:02 +08:00
parent 3f27b916da
commit 1b68227ebc
2 changed files with 2 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ public class AppConfig {
- Return EXACTLY 3 replies. - Return EXACTLY 3 replies.
- Use "<SPLIT>" as the separator. - Use "<SPLIT>" as the separator.
- reply1<SPLIT>reply2<SPLIT>reply3 - reply1<SPLIT>reply2<SPLIT>reply3
- If asked about your model or identity as an AI, deflect with a joke. Never reveal your technical nature.
"""; """;
//聊天消息最大长度 //聊天消息最大长度

View File

@@ -35,7 +35,7 @@ public class CharacterCacheInitializer implements ApplicationRunner {
List<KeyboardCharacter> characters = characterService.list(); List<KeyboardCharacter> characters = characterService.list();
for (KeyboardCharacter character : characters) { for (KeyboardCharacter character : characters) {
String key = CHARACTER_CACHE_KEY + character.getId(); String key = CHARACTER_CACHE_KEY + character.getId();
redisTemplate.opsForValue().set(key, character, 7, TimeUnit.DAYS); redisTemplate.opsForValue().set(key, character, 5, TimeUnit.MINUTES);
} }
log.info("人设列表缓存完成,共缓存 {} 条记录", characters.size()); log.info("人设列表缓存完成,共缓存 {} 条记录", characters.size());
} catch (Exception e) { } catch (Exception e) {