feat: 查询ppt apikey

This commit is contained in:
ageer
2025-05-24 20:06:19 +08:00
parent 373424bd01
commit 147b3fd8f5
5 changed files with 34 additions and 44 deletions

View File

@@ -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();
}

View File

@@ -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"));
}
}

View File

@@ -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>

View File

@@ -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());

View File

@@ -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());
}
/**
* 导出聊天模型列表
*/