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) {
|
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)
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue