AI 业务逻辑初始化
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package com.vetti.web.controller.ai;
|
||||
|
||||
import com.vetti.common.ai.elevenLabs.ElevenLabsClient;
|
||||
import com.vetti.common.ai.gpt.ChatGPTClient;
|
||||
import com.vetti.common.core.controller.BaseController;
|
||||
import com.vetti.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* AI 共通测试接口处理
|
||||
*
|
||||
* @author wangxiangshun
|
||||
*/
|
||||
@Api(tags ="AI 共通测试接口处理")
|
||||
@RestController
|
||||
@RequestMapping("/aiCommon")
|
||||
public class AiCommonController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ElevenLabsClient elevenLabsClient;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ChatGPTClient chatGPTClient;
|
||||
|
||||
/**
|
||||
* 进行文本转语音处理
|
||||
*/
|
||||
@ApiOperation("进行文本转语音处理")
|
||||
@GetMapping("/handleTextToVice")
|
||||
public AjaxResult handleTextToVice()
|
||||
{
|
||||
elevenLabsClient.handleTextToVoice("我只是测试的文本转换成语音","/Users/wangxiangshun/Desktop/临时文件/output.mp3");
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* AI 聊天
|
||||
*/
|
||||
@ApiOperation("AI 聊天")
|
||||
@GetMapping("/handleAiChat")
|
||||
public AjaxResult handleAiChat()
|
||||
{
|
||||
String resultMsg = chatGPTClient.handleAiChat("你好,我叫wangxiangshun");
|
||||
return AjaxResult.success(resultMsg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user