| | |
| | | } |
| | | |
| | | @PreAuthorize("isAuthenticated()") |
| | | @PostMapping("/ai/chat/session/memory/clear/{sessionId}") |
| | | public R clearSessionMemory(@PathVariable Long sessionId) { |
| | | aiChatService.clearSessionMemory(sessionId, getLoginUserId(), getTenantId()); |
| | | return R.ok("Clear Success").add(sessionId); |
| | | } |
| | | |
| | | @PreAuthorize("isAuthenticated()") |
| | | @PostMapping("/ai/chat/session/memory/retain-latest/{sessionId}") |
| | | public R retainLatestRound(@PathVariable Long sessionId) { |
| | | aiChatService.retainLatestRound(sessionId, getLoginUserId(), getTenantId()); |
| | | return R.ok("Retain Success").add(sessionId); |
| | | } |
| | | |
| | | @PreAuthorize("isAuthenticated()") |
| | | @PostMapping(value = "/ai/chat/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE) |
| | | public SseEmitter stream(@RequestBody AiChatRequest request) { |
| | | String requestId = StringUtils.hasText(request.getRequestId()) |