rasa:集成会话接口
parent
05aca5c443
commit
28cb30cbc2
@ -1,30 +1,30 @@
|
||||
package com.supervision.rasa.controller;
|
||||
|
||||
import com.supervision.rasa.pojo.vo.RasaTalkVo;
|
||||
import com.supervision.rasa.service.RasaTalkService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "rasa文件保存")
|
||||
@Api(tags = "ras对话服务")
|
||||
@RestController
|
||||
@RequestMapping("rasaFile")
|
||||
@RequestMapping("rasa")
|
||||
@RequiredArgsConstructor
|
||||
public class RasaTalkController {
|
||||
|
||||
@Autowired
|
||||
private RasaTalkService rasaTalkService;
|
||||
private final RasaTalkService rasaTalkService;
|
||||
|
||||
@ApiOperation("rasa对话")
|
||||
@GetMapping("talkRasa")
|
||||
public List<String> talkRasa(String question, String sessionId){
|
||||
@PostMapping("talkRasa")
|
||||
public List<String> talkRasa(@RequestBody RasaTalkVo rasaTalkVo){
|
||||
|
||||
return null;
|
||||
return rasaTalkService.talkRasa(rasaTalkVo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.supervision.rasa.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RasaTalkVo {
|
||||
|
||||
/**
|
||||
* 问题
|
||||
*/
|
||||
private String question;
|
||||
/**
|
||||
* 会话标识
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
/**
|
||||
* 模型id
|
||||
*/
|
||||
private String modelId;
|
||||
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
package com.supervision.rasa.service;
|
||||
|
||||
import com.supervision.rasa.pojo.vo.RasaTalkVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RasaTalkService {
|
||||
|
||||
|
||||
List<String> talkRasa(String question, String sessionId) ;
|
||||
List<String> talkRasa(RasaTalkVo rasaTalkVo) ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue