2025年4月21日15:16:51
parent
075c09f223
commit
60358cd8d8
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
|
|
@ -28,7 +28,7 @@ public class CommonConfiguration {
|
|||
public ChatClient chatClient(OllamaChatModel model, ChatMemory chatMemory) {
|
||||
return ChatClient
|
||||
.builder(model)
|
||||
.defaultSystem("你是一个热心、可爱的智能助手,你的名字叫小团团,请以小团团的身份和语气回答问题。")
|
||||
//.defaultSystem("你是一个热心、可爱的智能助手,你的名字叫小团团,请以小团团的身份和语气回答问题。")
|
||||
.defaultAdvisors(
|
||||
new SimpleLoggerAdvisor(),
|
||||
new MessageChatMemoryAdvisor(chatMemory)
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ public class ChatController {
|
|||
@RequestMapping(value = "/chat", produces = "text/html;charset=utf-8")
|
||||
public Flux<String> chat(
|
||||
@RequestParam("prompt") String prompt,
|
||||
@RequestParam("chatId") String chatId,
|
||||
@RequestParam(value = "files", required = false) List<MultipartFile> files) {
|
||||
@RequestParam("chatId") String chatId
|
||||
) {
|
||||
|
||||
// 1.保存会话id
|
||||
chatHistoryRepository.save("chat", chatId);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: deepseek-local-chat
|
||||
|
|
@ -10,4 +11,6 @@ spring:
|
|||
logging:
|
||||
level:
|
||||
org.springframework.ai.chat.client.advisor: DEBUG
|
||||
com.zhangmeng.deepseek.local.chat: DEBUG
|
||||
com.zhangmeng.deepseek.local.chat: DEBUG
|
||||
server:
|
||||
port: 8083
|
||||
Loading…
Reference in New Issue