| | |
| | | private AiUtils aiUtils; |
| | | |
| | | @GetMapping("/runAiStream") |
| | | public SseEmitter runAiStream() { |
| | | public SseEmitter runAiStream(@RequestParam(value = "chatId", required = false) String chatId, |
| | | @RequestParam(value = "reset", required = false, defaultValue = "false") boolean reset) { |
| | | SseEmitter emitter = new SseEmitter(0L); |
| | | |
| | | new Thread(() -> { |
| | | try { |
| | | WcsDiagnosisRequest request = aiUtils.makeAiRequest(1000, "对当前系统进行巡检,如果有异常情况就进行详细的分析,如果没有异常情况则当成一次检查\n\n"); |
| | | wcsDiagnosisService.diagnoseStream(request, emitter); |
| | | wcsDiagnosisService.diagnoseStream(request, chatId, reset, emitter); |
| | | } catch (Exception e) { |
| | | try { emitter.complete(); } catch (Exception ignore) {} |
| | | } |