Java资源分享网 - 专业的Java学习网站 学Java,上Java资源分享网
快速入门Spring Cloud Alibaba AI,搭建大模型,快速上手大模型 PDF 下载
发布于:2024-07-31 14:14:36
(假如点击没反应,多刷新两次就OK!)

快速入门Spring Cloud Alibaba AI,搭建大模型,快速上手大模型 PDF 下载 图1

 

 

资料内容:

 

controller
controller层还有一个类,用于对外提供接口
 
@RestController
@RequestMapping("/ai")
@CrossOrigin
public class TongYiController {
@Autowired
@Qualifier("tongYiSimpleServiceImpl")
private TongYiService tongYiSimpleService;
1
@GetMapping("/example")
public String completion(
@RequestParam(value = "message", defaultValue = "Tell me a
joke")
String message
) {
return tongYiSimpleService.completion(message);
}
}

 

service
service层用于对controller提供服务
 
public interface TongYiService {
/**
* Hello World example.
*
* @param message conversation content question.
* @return AI answer.
*/
String completion(String message);
}