mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-15 12:53:42 +00: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.TableDataInfo;
|
||||||
import org.ruoyi.core.page.PageQuery;
|
import org.ruoyi.core.page.PageQuery;
|
||||||
|
import org.ruoyi.domain.ChatModel;
|
||||||
import org.ruoyi.domain.bo.ChatModelBo;
|
import org.ruoyi.domain.bo.ChatModelBo;
|
||||||
import org.ruoyi.domain.vo.ChatModelVo;
|
import org.ruoyi.domain.vo.ChatModelVo;
|
||||||
|
|
||||||
@@ -53,4 +54,8 @@ public interface IChatModelService {
|
|||||||
*/
|
*/
|
||||||
ChatModelVo selectModelByName(String modelName);
|
ChatModelVo selectModelByName(String modelName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取ppt模型信息
|
||||||
|
*/
|
||||||
|
ChatModel getPPT();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,8 +120,11 @@ public class ChatModelServiceImpl implements IChatModelService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ChatModelVo selectModelByName(String modelName) {
|
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>
|
<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解析器 -->
|
<!-- pdf解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.pdfbox</groupId>
|
<groupId>org.apache.pdfbox</groupId>
|
||||||
@@ -52,18 +63,11 @@
|
|||||||
<artifactId>langchain4j</artifactId>
|
<artifactId>langchain4j</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.langchain4j</groupId>
|
<groupId>dev.langchain4j</groupId>
|
||||||
<artifactId>langchain4j-weaviate</artifactId>
|
<artifactId>langchain4j-weaviate</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>dev.langchain4j</groupId>
|
|
||||||
<artifactId>langchain4j-embeddings-all-minilm-l6-v2</artifactId>
|
|
||||||
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.testcontainers</groupId>
|
<groupId>org.testcontainers</groupId>
|
||||||
<artifactId>weaviate</artifactId>
|
<artifactId>weaviate</artifactId>
|
||||||
@@ -80,45 +84,11 @@
|
|||||||
<artifactId>langchain4j-ollama</artifactId>
|
<artifactId>langchain4j-ollama</artifactId>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>dev.langchain4j</groupId>
|
<groupId>dev.langchain4j</groupId>
|
||||||
<artifactId>langchain4j-document-parser-apache-tika</artifactId>
|
<artifactId>langchain4j-document-parser-apache-tika</artifactId>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -25,11 +25,13 @@ public class OkHttpConfig {
|
|||||||
public void init() {
|
public void init() {
|
||||||
initializeOkHttpUtil("suno");
|
initializeOkHttpUtil("suno");
|
||||||
initializeOkHttpUtil("luma");
|
initializeOkHttpUtil("luma");
|
||||||
initializeOkHttpUtil("ppt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeOkHttpUtil(String modelName) {
|
private void initializeOkHttpUtil(String modelName) {
|
||||||
ChatModelVo chatModelVo = chatModelService.selectModelByName(modelName);
|
ChatModelVo chatModelVo = chatModelService.selectModelByName(modelName);
|
||||||
|
if(chatModelVo==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
OkHttpUtil okHttpUtil = new OkHttpUtil();
|
OkHttpUtil okHttpUtil = new OkHttpUtil();
|
||||||
okHttpUtil.setApiHost(chatModelVo.getApiHost());
|
okHttpUtil.setApiHost(chatModelVo.getApiHost());
|
||||||
okHttpUtil.setApiKey(chatModelVo.getApiKey());
|
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.excel.utils.ExcelUtil;
|
||||||
import org.ruoyi.common.idempotent.annotation.RepeatSubmit;
|
import org.ruoyi.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.ruoyi.core.page.TableDataInfo;
|
import org.ruoyi.core.page.TableDataInfo;
|
||||||
|
import org.ruoyi.domain.ChatModel;
|
||||||
import org.ruoyi.domain.bo.ChatModelBo;
|
import org.ruoyi.domain.bo.ChatModelBo;
|
||||||
import org.ruoyi.domain.vo.ChatModelVo;
|
import org.ruoyi.domain.vo.ChatModelVo;
|
||||||
import org.ruoyi.service.IChatModelService;
|
import org.ruoyi.service.IChatModelService;
|
||||||
@@ -55,6 +56,15 @@ public class ChatModelController extends BaseController {
|
|||||||
return R.ok(chatModelService.queryList(bo));
|
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