Commit 85a587a8 authored by 林洋洋's avatar 林洋洋

修改模型,修改流返回

parent 39155e13
...@@ -161,20 +161,20 @@ public class ChatController { ...@@ -161,20 +161,20 @@ public class ChatController {
} }
@Operation(summary = "智能数据报表对话", description = "智能数据报表对话") @Operation(summary = "智能数据报表对话", description = "智能数据报表对话")
@GetMapping(value = "/chat/report") @GetMapping(value = "/chat/report", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public String reportChat(@RequestParam String message, public Flux<String> reportChat(@RequestParam String message,
@RequestParam String conversationId) { @RequestParam String conversationId) {
Message systemMessage = new SystemMessage("你是一个AI问答助手,请用回答用户问题,使用相关工具"); Message systemMessage = new SystemMessage("你是一个AI问答助手,请用回答用户问题,使用相关工具");
Message userMessage = new UserMessage(message); Message userMessage = new UserMessage(message);
Prompt prompt = new Prompt(List.of(systemMessage, userMessage)); Prompt prompt = new Prompt(List.of(systemMessage, userMessage));
return openAiChatClient.prompt(prompt) return FluxUtils.wrapDeepSeekStream(deepseekChatClient.prompt(prompt)
.advisors(messageChatMemoryAdvisor) .advisors(messageChatMemoryAdvisor)
.advisors(a -> a.param(ChatMemory.CONVERSATION_ID, conversationId)) .advisors(a -> a.param(ChatMemory.CONVERSATION_ID, conversationId))
.tools(excelTools) .tools(excelTools)
.call() .stream()
.content(); .chatResponse());
} }
} }
\ No newline at end of file
...@@ -57,6 +57,7 @@ public class ConvertUtils { ...@@ -57,6 +57,7 @@ public class ConvertUtils {
log.error("文档生成或上传失败: {}", e.getMessage(), e); log.error("文档生成或上传失败: {}", e.getMessage(), e);
return false; return false;
} catch (Exception e) { } catch (Exception e) {
log.error("文档生成或上传失败: {}", e.getMessage(), e);
return false; return false;
} }
return true; return true;
......
...@@ -49,7 +49,7 @@ spring: ...@@ -49,7 +49,7 @@ spring:
chat: chat:
enabled: true enabled: true
options: options:
model: deepseek-r1-distill-llama-70b model: deepseek-r1-0528
mybatis-plus: mybatis-plus:
mapper-locations: classpath*:/mapper/*Mapper.xml # mapper文件位置 mapper-locations: classpath*:/mapper/*Mapper.xml # mapper文件位置
......
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