You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
994 B
Java

2 months ago
package com.supervision.pdfqaserver.controller;
import com.supervision.pdfqaserver.service.ChatService;
2 months ago
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
2 months ago
@Slf4j
@RestController
@RequestMapping("/chat")
2 months ago
@RequiredArgsConstructor
public class ChatController {
private final ChatService chatService;
2 months ago
2 months ago
/**
*
*
* @param userQuery
* @return
2 months ago
*/
@GetMapping(value = "/knowledgeQA", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<String> knowledgeQA(@RequestParam("userQuery") String userQuery) {
return chatService.knowledgeQA(userQuery);
2 months ago
}
}