Commit 39155e13 authored by 林洋洋's avatar 林洋洋

添加baseURL

parent 61d89fa9
......@@ -166,7 +166,7 @@ public class ChatController {
@RequestParam String conversationId) {
Message systemMessage = new SystemMessage("你是一个AI问答助手,请用回答用户问题,使用相关工具");
Message userMessage = new UserMessage("问题:" + message + "\n回答要求:请使用markdown格式输出");
Message userMessage = new UserMessage(message);
Prompt prompt = new Prompt(List.of(systemMessage, userMessage));
return openAiChatClient.prompt(prompt)
......
......@@ -12,6 +12,7 @@ import org.springframework.ai.document.Document;
import org.springframework.ai.vectorstore.SearchRequest;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.ai.vectorstore.filter.Filter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -35,7 +36,8 @@ public class ChatService {
private final VectorStore vectorStore;
private final ChatMemory chatMemory;
@Value("${file.local.base-url:http://8.152.98.45/api}")
private String baseUrl;
/**
* rag召回
*
......
......@@ -5,6 +5,7 @@ import com.ask.utils.ConvertUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Component;
......@@ -26,6 +27,9 @@ public class ExcelTools {
@Autowired
private ConvertUtils convertUtils;
@Value("${file.local.base-url:http://8.152.98.45/api}")
private String baseUrl;
private String formatLocalDate(LocalDate date) {
// 创建自定义格式器:2位年份.单/双位月.单/双位日
DateTimeFormatter formatter = new DateTimeFormatterBuilder()
......@@ -61,7 +65,7 @@ public class ExcelTools {
if(result){
jsonObject.set("success",true);
jsonObject.set("fileName",fileName);
jsonObject.set("filePath","/admin/sys-file/"+bucketName+"/"+fileName);
jsonObject.set("filePath",baseUrl+"/admin/sys-file/"+bucketName+"/"+fileName);
}else{
jsonObject.set("success",false);
jsonObject.set("fileName","");
......
......@@ -49,7 +49,7 @@ spring:
chat:
enabled: true
options:
model: deepseek-r1
model: deepseek-r1-distill-llama-70b
mybatis-plus:
mapper-locations: classpath*:/mapper/*Mapper.xml # mapper文件位置
......@@ -138,3 +138,4 @@ file:
local:
enable: true
base-path: /app/upFiles
base-url: http://8.152.98.45/api
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment