mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-13 21:27:19 +08:00
add clear api
This commit is contained in:
@@ -133,4 +133,9 @@ public class AiController {
|
||||
}
|
||||
departmentRepository.deleteByName(name);
|
||||
}
|
||||
|
||||
@PostMapping("/chat/refresh")
|
||||
void createNewConversation(Principal principal) {
|
||||
aiChatService.evictChatMemory(principal.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +53,11 @@ public class AiChatService {
|
||||
AiLlmConfig aiLlmConfig = precedenceLlmBy.orElseThrow(() -> new BusinessException("没有开启的大模型"));
|
||||
return aiLlmConfig.getCode();
|
||||
}
|
||||
|
||||
public void evictChatMemory(String sessionIdentifier) {
|
||||
deepSeekChatAssistant.evictChatMemory(sessionIdentifier);
|
||||
zhiPuChatAssistant.evictChatMemory(sessionIdentifier);
|
||||
zhiPuToolAssistant.evictChatMemory(sessionIdentifier);
|
||||
deepSeekToolAssistant.evictChatMemory(sessionIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user