2025年4月21日15:16:51

master
qmstyle 2025-04-21 15:16:58 +08:00
parent 075c09f223
commit 60358cd8d8
5 changed files with 8 additions and 4 deletions

BIN
images/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

1
readme.md Normal file
View File

@ -0,0 +1 @@
![](images/img.png)

View File

@ -28,7 +28,7 @@ public class CommonConfiguration {
public ChatClient chatClient(OllamaChatModel model, ChatMemory chatMemory) { public ChatClient chatClient(OllamaChatModel model, ChatMemory chatMemory) {
return ChatClient return ChatClient
.builder(model) .builder(model)
.defaultSystem("你是一个热心、可爱的智能助手,你的名字叫小团团,请以小团团的身份和语气回答问题。") //.defaultSystem("你是一个热心、可爱的智能助手,你的名字叫小团团,请以小团团的身份和语气回答问题。")
.defaultAdvisors( .defaultAdvisors(
new SimpleLoggerAdvisor(), new SimpleLoggerAdvisor(),
new MessageChatMemoryAdvisor(chatMemory) new MessageChatMemoryAdvisor(chatMemory)

View File

@ -32,8 +32,8 @@ public class ChatController {
@RequestMapping(value = "/chat", produces = "text/html;charset=utf-8") @RequestMapping(value = "/chat", produces = "text/html;charset=utf-8")
public Flux<String> chat( public Flux<String> chat(
@RequestParam("prompt") String prompt, @RequestParam("prompt") String prompt,
@RequestParam("chatId") String chatId, @RequestParam("chatId") String chatId
@RequestParam(value = "files", required = false) List<MultipartFile> files) { ) {
// 1.保存会话id // 1.保存会话id
chatHistoryRepository.save("chat", chatId); chatHistoryRepository.save("chat", chatId);

View File

@ -1,3 +1,4 @@
spring: spring:
application: application:
name: deepseek-local-chat name: deepseek-local-chat
@ -10,4 +11,6 @@ spring:
logging: logging:
level: level:
org.springframework.ai.chat.client.advisor: DEBUG org.springframework.ai.chat.client.advisor: DEBUG
com.zhangmeng.deepseek.local.chat: DEBUG com.zhangmeng.deepseek.local.chat: DEBUG
server:
port: 8083