|
|
|
@ -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<NoteRecordMapper, NoteRecord>
|
|
|
|
|
3. 必须考虑上下文语境和专业术语来确定正确的分类。
|
|
|
|
|
对话内容为:{question} {answer}
|
|
|
|
|
""";
|
|
|
|
|
List<Message> 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("开始分析:");
|
|
|
|
|