mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-14 05:03:43 +08:00
feat: 查询ppt apikey
This commit is contained in:
@@ -3,6 +3,7 @@ package org.ruoyi.service;
|
||||
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import org.ruoyi.domain.ChatModel;
|
||||
import org.ruoyi.domain.bo.ChatModelBo;
|
||||
import org.ruoyi.domain.vo.ChatModelVo;
|
||||
|
||||
@@ -53,4 +54,8 @@ public interface IChatModelService {
|
||||
*/
|
||||
ChatModelVo selectModelByName(String modelName);
|
||||
|
||||
/**
|
||||
* 获取ppt模型信息
|
||||
*/
|
||||
ChatModel getPPT();
|
||||
}
|
||||
|
||||
@@ -120,8 +120,11 @@ public class ChatModelServiceImpl implements IChatModelService {
|
||||
*/
|
||||
@Override
|
||||
public ChatModelVo selectModelByName(String modelName) {
|
||||
return baseMapper.selectVoOne(Wrappers.<ChatModel>lambdaQuery().eq(ChatModel::getModelName, modelName));
|
||||
return baseMapper.selectVoOne(Wrappers.<ChatModel>lambdaQuery().eq(ChatModel::getModelName, modelName));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChatModel getPPT() {
|
||||
return baseMapper.selectOne(Wrappers.<ChatModel>lambdaQuery().eq(ChatModel::getModelName, "ppt"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,17 @@
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.17.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- pdf解析器 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
@@ -52,18 +63,11 @@
|
||||
<artifactId>langchain4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-weaviate</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-embeddings-all-minilm-l6-v2</artifactId>
|
||||
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>weaviate</artifactId>
|
||||
@@ -80,45 +84,11 @@
|
||||
<artifactId>langchain4j-ollama</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-milvus</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>milvus</artifactId>
|
||||
<version>1.19.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-qdrant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>qdrant</artifactId>
|
||||
<version>1.19.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-document-parser-apache-tika</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- ruoyi-knowledge-api/pom.xml -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.17.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -25,11 +25,13 @@ public class OkHttpConfig {
|
||||
public void init() {
|
||||
initializeOkHttpUtil("suno");
|
||||
initializeOkHttpUtil("luma");
|
||||
initializeOkHttpUtil("ppt");
|
||||
}
|
||||
|
||||
private void initializeOkHttpUtil(String modelName) {
|
||||
ChatModelVo chatModelVo = chatModelService.selectModelByName(modelName);
|
||||
if(chatModelVo==null){
|
||||
return;
|
||||
}
|
||||
OkHttpUtil okHttpUtil = new OkHttpUtil();
|
||||
okHttpUtil.setApiHost(chatModelVo.getApiHost());
|
||||
okHttpUtil.setApiKey(chatModelVo.getApiKey());
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.ruoyi.chat.enums.DisplayType;
|
||||
import org.ruoyi.common.excel.utils.ExcelUtil;
|
||||
import org.ruoyi.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.domain.ChatModel;
|
||||
import org.ruoyi.domain.bo.ChatModelBo;
|
||||
import org.ruoyi.domain.vo.ChatModelVo;
|
||||
import org.ruoyi.service.IChatModelService;
|
||||
@@ -55,6 +56,15 @@ public class ChatModelController extends BaseController {
|
||||
return R.ok(chatModelService.queryList(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询ppt模型信息
|
||||
*/
|
||||
@GetMapping("/getPPT")
|
||||
public R<ChatModel> getPPT() {
|
||||
return R.ok(chatModelService.getPPT());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出聊天模型列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user