From c54c2fc3e0559c7a00686d4c25cadcabdc0dcb7a Mon Sep 17 00:00:00 2001 From: liu Date: Mon, 15 Jul 2024 17:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/police/service/impl/RecordServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/supervision/police/service/impl/RecordServiceImpl.java b/src/main/java/com/supervision/police/service/impl/RecordServiceImpl.java index 9cad421..7187969 100644 --- a/src/main/java/com/supervision/police/service/impl/RecordServiceImpl.java +++ b/src/main/java/com/supervision/police/service/impl/RecordServiceImpl.java @@ -30,6 +30,7 @@ import org.springframework.ai.chat.ChatResponse; import org.springframework.ai.chat.Generation; import org.springframework.ai.chat.messages.Message; import org.springframework.ai.chat.messages.SystemMessage; +import org.springframework.ai.chat.messages.UserMessage; import org.springframework.ai.chat.prompt.Prompt; import org.springframework.ai.ollama.OllamaChatClient; import org.springframework.beans.factory.annotation.Autowired; @@ -144,8 +145,7 @@ public class RecordServiceImpl extends ServiceImpl 3. 必须考虑上下文语境和专业术语来确定正确的分类。 对话内容为:{question} {answer} """; - List messages = new ArrayList<>(List.of(new SystemMessage(StrUtil.format(template, paramMap)))); - Prompt prompt = new Prompt(messages); + Prompt prompt = new Prompt(new UserMessage(StrUtil.format(template, paramMap))); StopWatch stopWatch = new StopWatch(); stopWatch.start(); log.info("开始分析:");