| | |
| | | import cc.mrbird.febs.yinhe.req.*; |
| | | import cc.mrbird.febs.yinhe.res.*; |
| | | import cc.mrbird.febs.yinhe.service.YhAiService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import reactor.core.publisher.Flux; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | return service.agentSysList(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页-智能体-查看详情", notes = "首页-智能体-查看详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = YHSysAgentInitVo.class) |
| | | }) |
| | | @PostMapping(value = "/agentSysInfo") |
| | | public FebsResponse agentSysInfo(@RequestBody @Validated YHSysAgentInitDto dto) { |
| | | |
| | | return service.agentSysInfo(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "退出", notes = "退出") |
| | | @PostMapping(value = "/logout") |
| | | public FebsResponse logout() { |
| | |
| | | return service.logout(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "初始化对话", notes = "初始化对话") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = YHSendInitVo.class) |
| | | }) |
| | | @PostMapping(value = "/initSend", produces = "application/json") |
| | | public FebsResponse initSend(@RequestBody @Validated YHSendInitDto dto) { |
| | | |
| | | return service.initSend(dto); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存对话消息", notes = "保存对话消息") |
| | | @PostMapping(value = "/saveContext") |
| | | public FebsResponse saveContext(@RequestBody @Validated YHSaveContextDto dto) { |
| | | |
| | | return service.saveContext(dto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("AI回答(流式)") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "流式响应", response = YHAitalkItemStreamVo.class), |
| | | }) |
| | | @PostMapping("/aiAnswer") |
| | | public Flux<FebsResponse> aiAnswer(@RequestBody @Validated YHAitalkItemStreamDto dto) { |
| | | if (StrUtil.isEmpty(dto.getTalkId()) || StrUtil.isEmpty(dto.getReqContext())|| StrUtil.isEmpty(dto.getReqContext())){ |
| | | return Flux.just(new FebsResponse().fail().message("参数异常")); |
| | | } |
| | | return service.aiAnswer(dto); |
| | | } |
| | | |
| | | } |