| | |
| | | import org.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import org.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import org.ruoyi.common.satoken.utils.LoginHelper; |
| | | import org.ruoyi.knowledge.service.EmbeddingService; |
| | | import org.ruoyi.system.domain.bo.ChatMessageBo; |
| | | import org.ruoyi.system.domain.request.translation.TranslationRequest; |
| | | import org.ruoyi.system.domain.vo.ChatMessageVo; |
| | | import org.ruoyi.system.service.IChatMessageService; |
| | | import org.ruoyi.system.service.ISseService; |
| | |
| | | |
| | | private final IChatMessageService chatMessageService; |
| | | |
| | | private final EmbeddingService embeddingService; |
| | | /** |
| | | * 聊天接口 |
| | | */ |
| | | @PostMapping("/send") |
| | | @ResponseBody |
| | | public SseEmitter sseChat(@RequestBody @Valid ChatRequest chatRequest, HttpServletRequest request) { |
| | | if (chatRequest.getModel().startsWith("ollama")) { |
| | | return ISseService.ollamaChat(chatRequest); |
| | | } |
| | | return ISseService.sseChat(chatRequest,request); |
| | | } |
| | | |
| | |
| | | return ISseService.textToSpeed(textToSpeech); |
| | | } |
| | | |
| | | /** |
| | | * 文本翻译 |
| | | * |
| | | * @param |
| | | */ |
| | | @PostMapping("/translation") |
| | | @ResponseBody |
| | | public String translation(@RequestBody TranslationRequest translationRequest) { |
| | | return ISseService.translation(translationRequest); |
| | | } |
| | | |
| | | @PostMapping("/dall3") |
| | | @ResponseBody |
| | | public R<List<Item>> dall3(@RequestBody @Valid Dall3Request request) { |